File: 08_TheFile.html

package info (click to toggle)
hdf5 1.8.13%2Bdocs-15
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 171,520 kB
  • sloc: ansic: 387,158; f90: 35,195; sh: 20,035; xml: 17,780; cpp: 13,516; makefile: 1,487; perl: 1,299; yacc: 327; lex: 178; ruby: 37
file content (3068 lines) | stat: -rwxr-xr-x 108,616 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<title>Chapter 3: The HDF5 File</title>

<!--(Meta)==========================================================-->


<!--(Links)=========================================================-->

<!--( Begin styles definition )=====================================-->
<link href="ed_styles/NewUGelect.css" rel="stylesheet" type="text/css">
<!--( End styles definition )=======================================-->

</head>

<body>

<!-- #BeginLibraryItem "/ed_libs/styles_UG.lbi" -->
<!--
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  * Copyright by The HDF Group.                                               *
  * Copyright by the Board of Trustees of the University of Illinois.         *
  * All rights reserved.                                                      *
  *                                                                           *
  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
  * terms governing use, modification, and redistribution, is contained in    *
  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
  * of the source code distribution tree; Copyright.html can be found at the  *
  * root level of an installed copy of the electronic HDF5 document set and   *
  * is linked from the top-level documents page.  It can also be found at     *
  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
  * access to either file, you may request a copy from help@hdfgroup.org.     *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 -->
<!-- #EndLibraryItem --><!-- HEADER LEFT "HDF5 User's Guide" -->
<!-- HEADER RIGHT "The HDF5 File" -->

<!--( TOC )=========================================================-->
<!--<SCRIPT language="JavaScript">                                  -->
<!--
document.writeln ('\
<table x-use-null-cells\
                align="right"\
		width="240"\
		cellspacing="0"\
		class="tocTable">\
  <tr valign="top"> \
    <td class="tocTableHeaderCell" colspan="2"> \
        <span class="TableHead">Chapter Contents</span></td>\
  </tr>\
-->
<!-- Table Version 3 --><!--\-->
<!--
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#Intro">1.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#Intro">Introduction</a></td> \
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#PModel">2.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#PModel">Programming Model</a></td>\
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#H5Dump">3.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#H5Dump">Using <code>h5dump</code></a></td> \
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#FuncSumms">4.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#FuncSumms">File Function Summaries</a></td>\
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#CrOpen">5.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#CrOpen">Create or Open a File</a></td> \
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#Close">6.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#Close">Close a File</a></td>\
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#PLists">7.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#PLists">File Property Lists</a>\
\
<br />\
&nbsp;&nbsp;&nbsp;\
Creating a list\
\
<br />\
&nbsp;&nbsp;&nbsp;\
Creation properties\
\
<br />\
&nbsp;&nbsp;&nbsp;\
Access properties\
\
	  </td>\
  </tr>\
  <tr valign="top"> \
    <td class="tocTableContentCell2"> \
      <a href="#Drivers">8.</a></td>\
    <td class="tocTableContentCell3">\
	  <a href="#Drivers">Storage Layouts and Drivers</a>\
\
<br />\
&nbsp;&nbsp;&nbsp;\
<span class="smallcaps">SEC2</span>, \
<span class="smallcaps">STDIO</span>,\
<br />\
&nbsp;&nbsp;&nbsp;\
<span class="smallcaps">FAMILY</span>, \
<span class="smallcaps">MULTI</span>,\
<br />\
&nbsp;&nbsp;&nbsp;\
<span class="smallcaps">SPLIT</span>, \
<span class="smallcaps">MPI</span>, \
<span class="smallcaps">CORE</span>,\
<br />\
&nbsp;&nbsp;&nbsp;\
--><!--<span class=code>STREAM</span>, --><!--\
<span class="smallcaps">LOG</span>\
\
	  </td>\
  </tr>\
\
  <tr valign="top"> \
    <td class="tocTableContentCell"> \
-->
<!-- editingComment -- "tocTableContentCell" and "tocTableContentCell4" \
--><!--\-->
<!-- are the table-closing cell class.\
    <td class="tocTableContentCell2"> \
--><!--\
      <a href="#Examples">9.</a></td>\
    <td class="tocTableContentCell4">\
	  <a href="#Examples">Code Examples</a>\
  </td></tr>\
</table>\
')
-->
<!-- </SCRIPT> -->
<!--(End TOC)=======================================================-->

<!-- editingComment
-->


<div align="center">
<a name="TOP">
<h2>Chapter 3<br /><font size="7">The HDF5 File</font></h2>
</a>
</div>


<a name="Intro">
<h3>3.1. Introduction</h3>
</a>
<p>The purpose of this chapter is to describe how to work with HDF5 data 
files. </p>

<p>If HDF5 data is to be written to or read from a file, the file must 
 first be explicitly created or opened with the appropriate file driver 
 and access privileges. Once all work with the file is complete, the file 
 must be explicitly closed. </p>

<p>This chapter discusses the following:</p>

<ul>
	
	<li>File access modes</li>
	<li>Creating, opening, and closing files</li>
	<li>The use of file creation property lists</li>
	<li>The use of file access property lists</li>
        <li>The use of low-level file drivers</li>
</ul>

 <p>This chapter assumes an understanding of the material presented 
 in the data model chapter, &ldquo;<a href="03_DataModel.html">HDF5 
 Data Model and File Structure</a>.&rdquo;</p>

<h4>3.1.1. <a name="FileAccessModes">File Access Modes</a></h4> 


<p>There are two issues regarding file access:</p>
  <ul>
      <li>What should happen when a new file is created but a file
          of the same name already exists?  Should the create action
          fail, or should the existing file be overwritten?</li>
      <li>Is a file to be opened with read-only or read-write access?</li>
  </ul>

<p>Four access modes address these concerns. Two of these modes can 
be used with <code>H5Fcreate</code>, and two modes can be used with 
<code>H5Fopen</code>.</p>
    <ul>
	<li><code>H5Fcreate</code> accepts <code>H5F_ACC_EXCL</code> or 
        <code>H5F_ACC_TRUNC</code> </li>
	<li><code>H5Fopen</code> accepts <code>H5F_ACC_RDONLY</code> 
            or <code>H5F_ACC_RDWR</code></li>
    </ul>
<p>The access modes are described in the table below.</p>

<!-- NEW PAGE -->

<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="2" align="left" valign="bottom">
        <b>Table 1. Access flags and modes</b></td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td width="25%"> 
        <b>Access Flag</b></td>
        <td width="75%"> 
        <b>Resulting Access Mode</b></td>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5F_ACC_EXCL</code></td>
        <td>
        If the file already exists, <code>H5Fcreate</code> fails.  
        If the file does not exist, it is created and opened with 
        read-write access. <i>(Default)</i></td></tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5F_ACC_TRUNC</code></td>
        <td>
        If the file already exists, the file is opened with read-write access, 
        and new data will overwrite any existing data. If the file does not 
        exist, it is created and opened with read-write access.</td></tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5F_ACC_RDONLY</code></td>
        <td>
        An existing file is opened with read-only access.  
        If the file does not exist, <code>H5Fopen</code> fails.
        <i>(Default)</i></td></tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5F_ACC_RDWR</code></td>
        <td>
        An existing file is opened with read-write access.  
        If the file does not exist, <code>H5Fopen</code> fails.</td></tr>
    <tr><td colspan="2"><hr color="green" size="3" /></td></tr>
</table>
<br />



<p>By default, <code>H5Fopen</code> opens a file for read-only access; 
 passing <code>H5F_ACC_RDWR</code> allows read-write access to the file. </p>

<p>By default, <code>H5Fcreate</code> fails if the file already exists; 
 only passing <code>H5F_ACC_TRUNC</code> allows the truncating of an 
 existing file.</p>


<h4>3.1.2. File Creation and File Access Properties</h4>

 <p>File creation and file access property lists control the 
    more complex aspects of creating and accessing files.  </p>

<p><span class="termDefinition">File creation property lists</span> 
    control the characteristics of a file such as 
    the size of the user-block, a user-definable data block;
    the size of data address parameters; properties of the B-trees 
    that are used to manage the data in the file; and certain 
    HDF5 library versioning information. </p>

 <p>See the <a href="#FileCreationProperties">&ldquo;File Creation 
    Properties,&rdquo;</a> section below, for a more detailed discussion 
    of file creation properties and appropriate references to the 
    <a href="../RM/RM_H5Front.html"> 
    <cite>HDF5 Reference Manual</cite></a>.
    If you have no special requirements for these file characteristics, 
    you can simply specify <code>H5P_DEFAULT</code> for the default 
    file creation property list when a file creation property list 
    is called for.</p>

<p><span class="termDefinition">File access property lists</span> 
    control properties and means of accessing a file such as 
    data alignment characteristics, metadata block and cache sizes,
    data sieve buffer size, garbage collection settings, and 
    parallel I/O. Data alignment, metadata block and cache sizes, 
    and data sieve buffer size are factors in improving I/O performance.</p>

    <p>See the <a href="#FileAccessProperties">&ldquo;File Access 
    Properties&rdquo;</a> section below for a more detailed discussion of 
    file access properties and appropriate references to the 
    <cite>HDF5 Reference Manual</cite>. If you have no special 
    requirements for these file access characteristics, you can simply 
    specify <code>H5P_DEFAULT</code> for the default file access 
    property list when a file access property list is called for.</p>

<!--(UML Model Box)=================================================-->

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="center">
        <hr color="green" size="3"/>
        <img src="Images/UML_FileAndProps.gif">
        </td></tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left" >
        <b>Figure 1. UML model for an HDF5 file and its property lists</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />



<h4>3.1.3. Low-level File Drivers</h4>

<p>The concept of an HDF5 file is actually rather abstract: 
 the address space for what is normally thought of as an HDF5 file
 might correspond to any of the following at the storage level:</p>
 <ul>
     <li>Single file on a standard file system</li>
     <li>Multiple files on a standard file system</li>
     <li>Multiple files on a parallel file system</li>
     <li>Block of memory within an application&rsquo;s memory space</li>
     <li>More abstract situations such as virtual files</li>
 </ul>
 <p>This HDF5 address space is generally referred to as an <em>HDF5 file</em> 
    regardless of its organization at the storage level. </p>

 <p>HDF5 accesses a file (the address space) through various types of 
    <em>low-level file drivers</em>. The default HDF5 file storage 
    layout is as an unbuffered permanent file which is a single, 
    contiguous file on local disk. Alternative layouts are designed to 
    suit the needs of a variety of systems, environments, and applications.</p>

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="PModel">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="PModel">
<h3 class="pagebefore">3.2. Programming Model</h3>
</a>
    <p>Programming models for creating, opening, and closing HDF5 files 
    are described in the sub-sections below.</p>
    
<h4>3.2.1. Creating a New File</h4>

<p>The programming model for creating 
 a new HDF5 file can be summarized as follows:</p>

<ul>
	<li>Define the file creation property list</li>
	<li>Define the file access property list</li>
	<li>Create the file</li>
</ul>

<p>First, consider the simple case where we use the default 
values for the property lists. See the example below.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  file_id = H5Fcreate ("SampleFile.h5", H5F_ACC_EXCL,
      H5P_DEFAULT, H5P_DEFAULT)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 1. Creating an HDF5 file using property list defaults</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

 <p>Note that this example specifies that <code>H5Fcreate</code> should fail 
 if <code>SampleFile.h5</code> already exists.</p>

    <p>A more complex case is shown in the example below. In this example, 
    we define file creation and access property lists (though we do not 
    assign any properties), specify that <code>H5Fcreate</code> should 
    fail if <code>SampleFile.h5</code> already exists, and create a 
    new file named <code>SampleFile.h5</code>. The example does not 
    specify a driver, so the default driver, 
    <code>H5FD_SEC2</code>, will be used.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  fcplist_id = H5Pcreate (H5P_FILE_CREATE)
    &lt;...<em>set desired file creation properties</em>...&gt;
  faplist_id = H5Pcreate (H5P_FILE_ACCESS)
    &lt;...<em>set desired file access properties</em>...&gt;
  file_id = H5Fcreate ("SampleFile.h5", H5F_ACC_EXCL, fcplist_id, faplist_id)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 2. Creating an HDF5 file using property lists</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

    <p>Notes: </p>
    <p>A root group is automatically created in a file when the file 
    is first created.</p>
    <p>File property lists, once defined, can be reused when another 
    file is created within the same application.</p>


<h4>3.2.2. Opening an Existing File</h4>

<p>The programming model for opening an existing HDF5 file can be summarized 
 as follows:</p>

<ul>
	<li>Define or modify the file access property list 
            including a low-level file driver (optional)</li>
	<li>Open the file</li>
</ul>


    <p>The code in the example below shows how to open an existing file with
    read-only access.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  faplist_id = H5Pcreate (H5P_FILE_ACCESS)
  status = H5Pset_fapl_stdio (faplist_id)
  file_id = H5Fopen ("SampleFile.h5", H5F_ACC_RDONLY, faplist_id)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 3. Opening an HDF5 file</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

<h4>3.2.3. Closing a File</h4>

<p>The programming model for closing an HDF5 file is very simple:</p>

<ul>
    <li>Close file</li>
</ul>

<p>We close <code>SampleFile.h5</code> with the code in the example below.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  status = H5Fclose (file_id)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 4. Closing an HDF5 file</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

<p>Note that <code>H5Fclose</code> flushes all unwritten data to storage and 
that <code>file_id</code> is the identifier returned for 
<code>SampleFile.h5</code> by <code>H5Fopen</code>.</p>

<p>More comprehensive discussions regarding all of these steps 
   are provided below.</p>

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="H5Dump">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="H5Dump">
<h3 class="pagebefore">3.3. Using <code>h5dump</code> to View a File</h3>
</a>

<p><code>h5dump</code> is a command-line utility that is included in 
the HDF5 distribution. This program provides a straight-forward means of 
inspecting the contents of an HDF5 file. You can use <code>h5dump</code>
to verify that a program is generating the intended HDF5 file. 
<code>h5dump</code> displays ASCII output formatted according to the 
HDF5 DDL grammar.</p>

<p>The following <code>h5dump</code> command will display the 
contents of <code>SampleFile.h5</code>:</p>

<pre>
    h5dump SampleFile.h5 
</pre>

<p>If no datasets or groups have been created in and 
no data has been written to the file, 
the output will look something like the following:</p>

<pre>
    HDF5 "SampleFile.h5" {
    GROUP "/" {
    }
    }
</pre>

<p>Note that the root group, indicated above by <code>/</code>, 
 was automatically created when the file was created.</p>

<p><code>h5dump</code> is fully described on the 
 <a href="../RM/Tools.html" target="RMwindow">Tools</a> page of the 
 <a href="../RM/RM_H5Front.html" target="RMwindow">
 <cite>HDF5 Reference Manual</cite></a>.
 The HDF5 DDL grammar is fully described in the document
 <a href="../ddl.html" target="RMwindow">DDL in BNF for HDF5</a>,
 an element of this <cite>HDF5 User&rsquo;s Guide</cite>.</p>

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="FuncSumms">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="FuncSumms">
<h3 class="pagebefore">3.4. File Function Summaries</h3>
</a>
<p>General library functions and macros (H5), file functions (H5F), file 
   related property list functions (H5P), and file driver functions (H5P) 
   are listed below.</p>

   
<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="3" align="left" valign="bottom">
        <b>Function Listing 1. General library functions and macros (H5)
        </b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td>
        <b>C Function<br />Fortran Function</b></td><td>&nbsp;</td>
        <td>
        <b>Purpose</b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5check_version</code>
        <br />
        <code>h5check_version_f</code></td><td>&nbsp;</td>
        <td>
        Verifies that HDF5 library versions are consistent.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5close</code>
        <br />
        <code>h5close_f</code></td><td>&nbsp;</td>
        <td>
        Flushes all data to disk, closes all open identifiers, and cleans up 
        memory.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5dont_atexit</code>
        <br />
        <code>h5dont_atexit_f</code></td><td>&nbsp;</td>
        <td>
        Instructs the library not to install the <code>atexit</code> cleanup 
        routine. </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5garbage_collect</code>
        <br />
        <code>h5garbage_collect_f</code></td><td>&nbsp;</td>
        <td>
        Garbage collects on all free-lists of all types. </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5get_libversion</code>
        <br />
        <code>h5get_libversion_f</code></td><td>&nbsp;</td>
        <td>
        Returns the HDF library release number.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5open</code>
        <br />
        <code>h5open_f</code></td><td>&nbsp;</td>
        <td>
        Initializes the HDF5 library.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5set_free_list_limits</code>
        <br />
        <code>h5set_free_list_limits_f</code></td><td>&nbsp;</td>
        <td>
        Sets free-list size limits.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5_VERSION_GE</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Determines whether the version of the library being used is greater 
        than or equal to the specified version.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5_VERSION_LE</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Determines whether the version of the library being used is less than 
        or equal to the specified version.</td>
        </tr>
        <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
</table>
<br /><br />
   
   
<!-- NEW PAGE -->
<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="3" align="left" valign="bottom">
        <b>Function Listing 2. File functions (H5F)
        </b></td></tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td>
        <b>C Function<br />Fortran Function</b></td><td>&nbsp;</td>
        <td>
        <b>Purpose</b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fclear_elink_file_cache</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Clears the external link open file cache for a file. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fclose</code>
        <br />
        <code>h5fclose_f</code></td><td>&nbsp;</td>
        <td>
        Closes HDF5 file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fcreate</code>
        <br />
        <code>h5fcreate_f</code></td><td>&nbsp;</td>
        <td>
        Creates new HDF5 file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fflush</code>
        <br />
        <code>h5fflush_f</code></td><td>&nbsp;</td>
        <td>
        Flushes data to HDF5 file on storage medium.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_access_plist</code>
        <br />
        <code>h5fget_access_plist_f</code></td><td>&nbsp;</td>
        <td>
        Returns a file access property list identifier.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_create_plist</code>
        <br />
        <code>h5fget_create_plist_f</code></td><td>&nbsp;</td>
        <td>
        Returns a file creation property list identifier.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_file_image</code>
        <br />
        <code>h5fget_file_image_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves a copy of the image of an existing, open file. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_filesize</code>
        <br />
        <code>h5fget_filesize_f</code></td><td>&nbsp;</td>
        <td>
        Returns the size of an HDF5 file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_freespace</code>
        <br />
        <code>h5fget_freespace_f</code></td><td>&nbsp;</td>
        <td>
        Returns the amount of free space in a file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_info</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Returns global information for a file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_intent</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Determines the read/write or read-only status of a file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_mdc_config</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Obtain current metadata cache configuration for target file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_mdc_hit_rate</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Obtain target file&rsquo;s metadata cache hit rate.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_mdc_size</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Obtain current metadata cache size data for specified file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_mpi_atomicity</code>
        <br />
        <code>h5fget_mpi_atomicity_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves the atomicity mode in use. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_name</code>
        <br />
        <code>h5fget_name_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves the name of the file to which the object belongs.
        </td>
        </tr>
    <!-- NEW PAGE -->
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_obj_count</code>
        <br />
        <code>h5fget_obj_count_f</code></td><td>&nbsp;</td>
        <td>
        Returns the number of open object identifiers for an open file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_obj_ids</code>
        <br />
        <code>h5fget_obj_ids_f</code></td><td>&nbsp;</td>
        <td>
        Returns a list of open object identifiers.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fget_vfd_handle</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Returns pointer to the file handle from the virtual file driver.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fis_hdf5</code>
        <br />
        <code>h5fis_hdf5_f</code></td><td>&nbsp;</td>
        <td>
        Determines whether a file is in the HDF5 format.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fmount</code>
        <br />
        <code>h5fmount_f</code></td><td>&nbsp;</td>
        <td>
        Mounts a file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fopen</code>
        <br />
        <code>h5fopen_f</code></td><td>&nbsp;</td>
        <td>
        Opens existing HDF5 file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Freopen</code>
        <br />
        <code>h5freopen_f</code></td><td>&nbsp;</td>
        <td>
        Returns a new identifier for a previously-opened HDF5 file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Freset_mdc_hit_rate_stats</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Reset hit rate statistics counters for the target file. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fset_mdc_config</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Use to configure metadata cache of target file. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Fset_mpi_atomicity</code>
        <br />
        <code>h5fset_mpi_atomicity_f</code></td><td>&nbsp;</td>
        <td>
        Use to set the MPI atomicity mode. 
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Funmount</code>
        <br />
        <code>h5funmount_f</code></td><td>&nbsp;</td>
        <td>
        Unmounts a file.
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
</table>
<br /><br />

<!-- NEW PAGE -->
<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="3" align="left" valign="bottom">
        <b>Function Listing 3. File creation property list functions (H5P)
        </b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
    <tr valign="top">
        <td>
        <b>C Function<br />Fortran Function</b></td><td>&nbsp;</td>
        <td>
        <b>Purpose</b></td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_userblock</code>
        <br />
        <code>h5pset/get_userblock_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves size of user-block.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_sizes</code>
        <br />
        <code>h5pset/get_sizes_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves byte size of offsets and lengths used to 
        address objects in HDF5 file.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_sym_k</code>
        <br />
        <code>h5pset/get_sym_k_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves size of parameters used to control 
        symbol table nodes.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_istore_k</code>
        <br />
        <code>h5pset/get_istore_k_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves size of parameter used to control B-trees 
        for indexing chunked datasets.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_file_image</code>
        <br />
        <code>h5pget_file_image_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves a copy of the file image designated as the initial 
        content and structure of a file. </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_file_image</code>
        <br />
        <code>h5pset_file_image_f</code></td><td>&nbsp;</td>
        <td>
        Sets an initial file image in a memory buffer. </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_shared_mesg_nindexes</code>
        <br />
        <code>h5pset_shared_mesg_nindexes_f</code></td><td>&nbsp;</td>
        <td>
        Sets number of shared object header message indexes. </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_shared_mesg_nindexes</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves number of shared object header message indexes in 
        file creation property list. </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_shared_mesg_index</code>
        <br />
        <code>h5pset_shared_mesg_index_f</code></td><td>&nbsp;</td>
        <td>
        Configures the specified shared object header message index.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_shared_mesg_index</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves the configuration settings for a shared message index. 
        </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_shared_mesg_phase_change</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Sets shared object header message storage phase change thresholds. 
        </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_shared_mesg_phase_change</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves shared object header message phase change information. 
        </td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_version</code>
        <br />
        <code>h5pget_version_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves version information for various objects for 
        file creation property list.</td></tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
</table>
<br /><br />


<!-- NEW PAGE -->
<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="3" align="left" valign="bottom">
        <b>Function Listing 4. File access property list functions (H5P)
        </b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td>
        <b>C Function<br />Fortran Function</b>
        </td><td>&nbsp;</td>
        <td>
        <b>Purpose</b>
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_alignment</code>
        <br />
        <code>h5pset/get_alignment_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves alignment properties.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_cache</code>
        <br />
        <code>h5pset/get_cache_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves metadata cache and raw data chunk cache 
        parameters.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_elink_file_cache_size</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves the size of the external link open file cache 
        from the specified file access property list. </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_fclose_degree</code>
        <br />
        <code>h5pset/get_fclose_degree_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves file close degree property.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_gc_references</code>
        <br />
        <code>h5pset/get_gc_references_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves garbage collecting references flag.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_family_offset</code>
        <br />
        <code>h5pset_family_offset_f</code></td><td>&nbsp;</td>
        <td>
        Sets offset property for low-level access to a file in a family of 
        files.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_family_offset</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves a data offset from the file access property list.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_meta_block_size</code>
        <br />
        <code>h5pset/get_meta_block_size_f</code></td><td>&nbsp;</td>
        <td>
        Sets the minimum metadata block size or 
        retrieves the current metadata block size setting.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_mdc_config</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Set the initial metadata cache configuration in the indicated 
        File Access Property List to the supplied value.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_mdc_config</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Get the current initial metadata cache configuration from the 
        indicated File Access Property List.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_sieve_buf_size</code>
        <br />
        <code>h5pset/get_sieve_buf_size_f</code></td><td>&nbsp;</td>
        <td>
        Sets/retrieves maximum size of data sieve buffer.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_libver_bounds</code>
        <br />
        <code>h5pset_libver_bounds_f</code></td><td>&nbsp;</td>
        <td>
        Sets bounds on library versions, and indirectly format versions, 
        to be used when creating objects.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_libver_bounds</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves library version bounds settings that indirectly control 
        the format versions used when creating objects.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_small_data_block_size</code>
        <br />
        <code>h5pset_small_data_block_size_f</code></td><td>&nbsp;</td>
        <td>
        Sets the size of a contiguous block reserved for small data.</td>
        </tr>
    <!-- NEW PAGE -->
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_small_data_block_size</code>
        <br />
        <code>h5pget_small_data_block_size_f</code></td><td>&nbsp;</td>
        <td>
        Retrieves the current small data block size setting.</td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
</table>
<br /><br />



<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="3" align="left" valign="bottom">
        <b>Function Listing 5. File driver functions (H5P)
        </b></td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td>
        <b>C Function<br />Fortran Function</b>
        </td><td>&nbsp;</td>
        <td>
        <b>Purpose</b>
        </td>
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_driver</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Sets a file driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_driver</code>
        <br />
        <code>h5pget_driver_f</code></td><td>&nbsp;</td>
        <td>
        Returns the identifier for the driver used to create a file.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_driver_info</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Returns a pointer to file driver information.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_fapl_core</code>
        <br />
        <code>h5pset/get_fapl_core_f</td><td>&nbsp;</td>
        <td>
        Sets driver for buffered memory files (i.e., in RAM) 
        or retrieves information regarding driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_direct</code>
        <br />
        <code>h5pset_fapl_direct_f</td><td>&nbsp;</td>
        <td>
        Sets up use of the direct I/O driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_fapl_direct</code>
        <br />
        <code>h5pget_fapl_direct_f</td><td>&nbsp;</td>
        <td>
        Retrieves direct I/O driver settings.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_fapl_family</code>
        <br />
        <code>h5pset/get_fapl_family_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for file families, 
        designed for systems that do not support files larger than 2 gigabytes,
        or retrieves information regarding driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_log</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Sets logging driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_fapl_mpio</code>
        <br />
        <code>h5pset/get_fapl_mpio_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for files on parallel file systems (MPI I/O)
        or retrieves information regarding the driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_mpiposix</code>
        <br />
        <code>h5pset_fapl_mpiposix_f</code></td><td>&nbsp;</td>
        <td>
        No longer available.
        </td>
        <!-- vfd no longer available. 3.28.2014.
        <td>
        Stores MPI IO communicator information to a file access property list.
        </td>
        -->
        </tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_fapl_mpiposix</code>
        <br />
        <code>h5pget_fapl_mpiposix_f</code></td><td>&nbsp;</td>
        <td>
        No longer available.
        </td>
        <!-- vfd no longer available. 3.28.2014.
        <td>
        Returns MPI communicator information.
        </td>
        -->
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset/get_fapl_multi</code>
        <br />
        <code>h5pset/get_fapl_multi_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for multiple files, 
        separating categories of metadata and raw data,
        or retrieves information regarding driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_sec2</code>
        <br />
        <code>h5pset_fapl_sec2_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for unbuffered permanent files or retrieves information 
        regarding driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_split</code>
        <br />
        <code>h5pset_fapl_split_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for split files, a limited case of multiple files
        with one metadata file and one raw data file.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_stdio</code>
        <br />
        <code>H5Pset_fapl_stdio_f</code></td><td>&nbsp;</td>
        <td>
        Sets driver for buffered permanent files.</td></tr>
<!--
<tr valign="top">
<td colspan="1"
	rowspan="1"
	style="padding-right: 10px; padding-left: 10px;
                        border-bottom-width: 1px;
                        border-bottom-color: #008000;
                        border-bottom-style: Solid;"
	width="23.025%">
<code>H5Pset/get_fapl_stream</code>
   <br />
   (none)</td>
<td colspan="1"
	rowspan="1"
	style="padding-right: 10px; padding-left: 10px;
                        border-bottom-width: 1px;
                        border-bottom-color: #008000;
                        border-bottom-style: Solid;"
	width="76.975%">
Sets driver for streaming data (i.e., no stored file)
 or retrieves information regarding driver.</td></tr>
-->

    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_fapl_windows</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Sets the Windows I/O driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pset_multi_type</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Specifies type of data to be accessed via the MULTI driver 
        enabling more direct access.</td></tr>
    <tr><td colspan="3"><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td>
        <code>H5Pget_multi_type</code>
        <br />
        <code>(none)</code></td><td>&nbsp;</td>
        <td>
        Retrieves type of data property for MULTI driver.</td></tr>
    <tr><td colspan="3"><hr color="green" size="3" /></td></tr>
</table>
<br />

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="CrOpen">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="CrOpen">
<h3 class="pagebefore">3.5. Creating or Opening an HDF5 File</h3>
</a>

<!-- editingComment
  <span class="editingComment">
  [ [ [ Link each function in 8.5 through 8.8 to its RM entry. ] ] ]
  </span>
-->
<p>This section describes in more detail how to create and how to open 
files. </p>

<p>New HDF5 files are created and opened with <code>H5Fcreate</code>; 
 existing files are opened with <code>H5Fopen</code>. 
 Both functions return an object identifier which must eventually 
 be released by calling <code>H5Fclose</code>.</p>

<dl>
 <dt><span class="RunningHead">To create a new file</span>, call 
 <code>H5Fcreate</code>:

 <dd>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>hid_t H5Fcreate (const char *<em>name</em>, 
          unsigned <em>flags</em>, 
          <br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          hid_t <em>fcpl_id</em>, 
          hid_t <em>fapl_id</em>)</code>
</dl>

<p><code>H5Fcreate</code> creates a new file named <code><em>name</em></code> 
 in the current directory. 
 The file is opened with read and write access; 
 if the <code>H5F_ACC_TRUNC</code> flag is set, any pre-existing file 
 of the same name in the same directory is truncated.
 If <code>H5F_ACC_TRUNC</code> is not set or
 <code>H5F_ACC_EXCL</code> is set and if a file of the same name exists,
 <code>H5Fcreate</code> will fail. </p>

<p>The new file is created with the properties specified in the property 
 lists <code><em>fcpl_id</em></code> and <code><em>fapl_id</em></code>. 
 <code>fcpl</code> is short for file creation property list. 
 <code>fapl</code> is short for file access property list. Specifying 
 <code>H5P_DEFAULT</code> for either the creation or access property 
 list calls for the library&rsquo;s default creation or access properties.
 See &ldquo;<a href="#PLists">File Property Lists</a>&rdquo; below 
 for details on setting property list values. 
 See &ldquo;<a href="#FileAccessModes">File Access Modes</a>&rdquo; 
 above for the list of file access flags and their descriptions.</p>
 
<p>If <code>H5Fcreate</code> successfully creates the file, 
 it returns a file identifier for the new file. This identifier will be 
 used by the application any time an object identifier, an OID, for the 
 file is required. Once the application has finished working with a file, 
 the identifier should be released and the file closed with 
 <code>H5Fclose</code>. </p>


<dl>
  <dt><span class="RunningHead">To open an existing file</span>, 
      call <code>H5Fopen</code>:

  <dd>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>hid_t H5Fopen (const char *<em>name</em>, unsigned <em>flags</em>, 
          hid_t <em>fapl_id</em>) </code>
</dl>

<p><code>H5Fopen</code> opens an existing file with 
 read-write access if <code>H5F_ACC_RDWR</code> is set and 
 read-only access if <code>H5F_ACC_RDONLY</code> is set. </p>

<p><em>fapl_id</em> is the file access property list identifier.
 Alternatively, <code>H5P_DEFAULT</code> indicates that the application
 relies on the default I/O access parameters. 
 Creating and changing access property lists is documented further below. </p>

<p>A file can be opened more than once via multiple <code>H5Fopen</code> 
 calls. Each such call returns a unique file identifier and the file can 
 be accessed through any of these file identifiers as long as they remain 
 valid. Each of these file identifiers must be released by calling 
 <code>H5Fclose</code> when it is no longer needed. </p>
 

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="Close">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="Close">
<h3 class="pagebefore">3.6. Closing an HDF5 File</h3>
</a>

<p><code>H5Fclose</code> both closes a file and releases the 
 file identifier returned by <code>H5Fopen</code> or <code>H5Fcreate</code>. 
 <code>H5Fclose</code> must be called when an application 
 is done working with a file; 
 while the HDF5 Library makes every effort to maintain file integrity,
 failure to call <code>H5Fclose</code> may result in the file 
 being abandoned in an incomplete or corrupted state. </p>

<dl>
  <dt><span class="RunningHead">To close a file</span>, 
      call <code>H5Fclose</code>:

  <dd>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>herr_t H5Fclose (hid_t <em>file_id</em>)</code>
</dl>

<p>This function releases resources associated with an open file.
 After closing a file, the file identifier, 
 <code><em>file_id</em></code>, cannnot be used again 
 as it will be undefined.</p>

<p><code>H5Fclose</code> fulfills three purposes: 
 to ensure that the file is left in an uncorrupted state, 
 to ensure that all data has been written to the file, 
 and to release resources.   Use 
 <a href="../RM/RM_H5F.html#File-Flush" target="RMwindow">
 <code>H5Fflush</code></a> if you wish to ensure that all data has 
 been written to the file but it is premature to close it.</p>

<p><em>Note regarding serial mode behavior:</em>
 When <code>H5Fclose</code> is called in serial mode, 
 it closes the file and terminates new access to it, 
 but it does not terminate access to objects that remain 
 individually open within the file.  
 That is, if <code>H5Fclose</code> is called for a file but one or 
 more objects within the file remain open, those objects will remain 
 accessible until they are individually closed.  
 To illustrate, assume that a file, <code>fileA</code>, contains 
 a dataset, <code>data_setA</code>, and that both are open when 
 <code>H5Fclose</code> is called for <code>fileA</code>. 
 <code>data_setA</code> will remain open and accessible, 
 including writable, until it is explicitly closed.  
 The file will be automatically and finally closed once all objects within 
 it have been closed.</p>

<p><em>Note regarding parallel mode behavior:</em>
 Once <code>H5Fclose</code> has been called in parallel mode,
 access is no longer available to any object within the file.</p>


<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="PLists">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="PLists">
<h3 class="pagebefore">3.7. File Property Lists</h3>
</a>

<p>Additional information regarding file structure and access 
 are passed to <code>H5Fcreate</code> and <code>H5Fopen</code> 
 through property list objects.
 Property lists provide a portable and extensible method of 
 modifying file properties via simple API functions. 
 There are two kinds of file-related property lists: </p>
 <ul>
    <li>File creation property lists
    <li>File access property lists
 </ul>

<p>
 In the following sub-sections, we discuss only one file creation property, 
 user-block size, in detail as a model for the user.  
 Other file creation and file access properties are mentioned and 
 defined briefly, but the model is not expanded for each; 
 complete syntax, parameter, and usage information for every 
 property list function is provided in the
 &ldquo;<a href="../RM/RM_H5P.html" target="RMwindow">H5P: Property List 
 Interface</a>&rdquo; chapter of the 
 <a href="../RM/RM_H5Front.html" target="RMwindow">
 <cite>HDF5 Reference Manual</cite></a>.</p>
 
<!-- editingComment
Also see 
 <span class=EditingComment>[ [ [ property lists chapter -- definitional 
 discussion ] ] ]</span> 
 in this <cite>HDF5 User's Guide</cite> for further discussion of 
 property lists.</p>
-->


<h4>3.7.1. Creating a Property List</h4>


<p>If you do not wish to rely on the default file creation and 
 access properties, you must first create a property list with 
 <code>H5Pcreate</code>.</p>

<dir><pre>
hid_t H5Pcreate (hid_t <em>cls_id</em>)
</pre></dir>

<p><code><em>type</em></code> is the type of property list being created.
In this case, the appropriate values are 
 <code>H5P_FILE_CREATE</code> for a file creation property list and
 <code>H5P_FILE_ACCESS</code> for a file access property list.</p>


<p>Thus, the following calls create a file creation property list and a 
 file access property list with identifiers <code><em>fcpl_id</em></code> 
 and <code><em>fapl_id</em></code>, respectively:
<dir><pre>
fcpl_id = H5Pcreate (H5P_FILE_CREATE) 
fapl_id = H5Pcreate (H5P_FILE_ACCESS) 
</pre></dir>

Once the property lists have been created, the properties themselves can 
be modified via the functions described in the following sub-sections.

<a name="FileCreationProperties">
<p>&nbsp;</p>
</a>


<h4>3.7.2. File Creation Properties</h4>


<p>File creation property lists control the file metadata, which is 
maintained in the superblock of the file. These properties are used 
only when a file is first created.</p>

<p><span class="RunningHead">User-block size </span></p>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>herr_t H5Pset_userblock (hid_t <em>plist</em>, 
          hsize_t <em>size</em>)</code>
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>herr_t H5Pget_userblock (hid_t <em>plist</em>, 
          hsize_t *<em>size</em>)</code>

 <p>The <em>user-block</em> is a fixed-length block of data 
 located at the beginning of the file and is ignored by the 
 HDF5 Library. 
 This block is specifically set aside for any data or information 
 that developers determine to be useful to their applications but 
 that will not be used by the HDF5 Library. 
 The <code><em>size</em></code> of the user-block is defined in bytes
 and may be set to any power of two with a minimum size of 512 bytes. 
 In other words, user-blocks might be 512, 1024, or 2048 bytes in size.</p>
 
 <p>This property is set with <code>H5Pset_userblock</code> 
 and queried via <code>H5Pget_userblock</code>. For example, if an 
 application needed a 4K user-block, then the following function call
 could be used:</p>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>status = H5Pset_userblock(fcpl_id, 4096)</code>

    <p>The property list could later be queried with</p>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <code>status = H5Pget_userblock(fcpl_id, size)</code>

    <p>and the value <code>4096</code> would be returned in the parameter
 <code><em>size</em></code>.</p>

 <p>Other properties, described below, are set and queried in exactly 
 the same manner. Syntax and usage are detailed in the 
 &ldquo;<a href="../RM/RM_H5P.html" target="RMwindow">H5P: Property List 
 Interface</a>&rdquo; section of the <a href="../RM/RM_H5Front.html" 
 target="RMwindow"><cite>HDF5 Reference Manual</cite></a>.
<!-- editingComment
 <span class=editingcomment>[ [ [ Though we could spell it all out here if 
 deemed necessary. ] ] ]</span>
-->
 </p>

<span class="RunningHead">Offset and length sizes </span>

 <p>This property specifies the number of bytes used to store 
 the offset and length of objects in the HDF5 file. 
 Values of 2, 4, and 8 bytes are currently supported 
 to accommodate 16-bit, 32-bit, and 64-bit file address spaces. </p>
 
 <p>These properties are set and queried via 
 <code>H5Pset_sizes</code> and <code>H5Pget_sizes</code>. 
 </p>

<span class="RunningHead">Symbol table parameters </span>


 <p>The size of symbol table B-trees can be controlled by 
 setting the 1/2-rank and 1/2-node size parameters of the B-tree. </p>
 
 <p>These properties are set and queried via 
 <code>H5Pset_sym_k</code> and <code>H5Pget_sym_k</code>. </p>

<span class="RunningHead">Indexed storage parameters </span>


 <p>The size of indexed storage B-trees can be controlled 
 by setting the 1/2-rank and 1/2-node size parameters of the B-tree. </p>
 
 <p>These properties are set and queried via 
 <code>H5Pset_istore_k</code> and <code>H5Pget_istore_k</code>. </p>

<span class="RunningHead">Version information </span>

 <p>Various objects in an HDF5 file may over time appear in different
 versions.  The HDF5 Library keeps track of the version of each object 
 in the file.  </p>

 <p>Version information is retrieved via <code>H5Pget_version</code>.</p>

<a name="FileAccessProperties">
<p>&nbsp;</p>
</a>

<!-- NEW PAGE -->
<h4>3.7.3. File Access Properties</h4>


<p>This section discusses file access properties that are not related to 
 the low-level file drivers.  
 File drivers are discussed separately in 
 &ldquo;<a href="#Drivers">Alternate File Storage Layouts and Low-level 
 File Drivers</a>,&rdquo; later in this chapter. </p>

<p>File access property lists control various aspects of file I/O
 and structure.  </p>

<dl>

<dt><span class="RunningHead">Data alignment </span>

<dd>Sometimes file access is faster if certain data elements are 
 aligned in a specific manner.  This can be controlled by setting alignment 
 properties via the <code>H5Pset_alignment</code> function. 
 There are two values involved:
 <ul>
    <li>A threshhold value</li>
    <li>An alignment interval</li>
 </ul>
 <p>Any allocation request at least as large as the threshold will 
 be aligned on an address that is a multiple of the alignment interval. </p>

<dt><span class="RunningHead">Metadata block allocation size</span>

<dd>Metadata typically exists as very small chunks of data;
 storing metadata elements in a file without blocking them can
 result in hundreds or thousands of very small data elements 
 in the file.  This can result in a highly fragmented file and 
 seriously impede I/O. By blocking metadata elements, these small 
 elements can be grouped in larger sets, thus alleviating both problems.
 
 <p>
 <code>H5Pset_meta_block_size</code> sets the minimum size in bytes
 of metadata block allocations.
 <code>H5Pget_meta_block_size</code> retrieves the current 
 minimum metadata block allocation size.</p>

<dt><span class="RunningHead">Metadata cache</span>

<dd>Metadata and raw data I/O speed are often governed by the size 
 and frequency of disk reads and writes.  In many cases, the speed 
 can be substantially improved by the use of an appropriate cache.
 
 <p>
 <code>H5Pset_cache</code> sets the minimum cache size for both 
 metadata and raw data and a preemption value for raw data chunks.
 <code>H5Pget_cache</code> retrieves the current values.
 </p>

<dt><span class="RunningHead">Data sieve buffer size</span>

<dd>Data sieve buffering is used by certain file drivers to speed
 data I/O and is most commonly when working with dataset hyperslabs.
 For example, using a buffer large enough to hold several pieces of 
 a dataset as it is read in for hyperslab selections will boost 
 performance noticeably.

 <p>
 <code>H5Pset_sieve_buf_size</code> sets the maximum size in bytes
 of the data sieve buffer.
 <code>H5Pget_sieve_buf_size</code> retrieves the current maximum size 
 of the data sieve buffer.
 </p>

<dt><span class="RunningHead">Garbage collection references</span>

<dd>Dataset region references and other reference types use space 
 in an HDF5 file&rsquo;s global heap. 
 If garbage collection is on (<code>1</code>) and the 
 user passes in an uninitialized value in a reference structure, 
 the heap might become corrupted. 
 When garbage collection is off (<code>0</code>), however, 
 and the user re-uses a reference, the previous heap block 
 will be orphaned and not returned to the free heap space.  
 When garbage collection is on, the user must initialize the 
 reference structures to <code>0</code> or risk heap corruption.

 <p>
 <code>H5Pset_gc_references</code> sets the garbage collecting 
 references flag. 
 </p>

</dl>

<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="Drivers">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>

<!-- NEW PAGE -->
<a name="Drivers">
<h3 class="pagebefore">3.8. Alternate File Storage Layouts and Low-level 
File Drivers</h3></a>

<p>The concept of an HDF5 file is actually rather abstract: 
 the address space for what is normally thought of as an HDF5 file
 might correspond to any of the following:
 <ul>
     <li>Single file on standard file system</li>
     <li>Multiple files on standard file system</li>
     <li>Multiple files on parallel file system</li>
     <li>Block of memory within application&rsquo;s memory space</li>
     <li>More abstract situations such as virtual files </li>
         <!--
         or streaming I/O
         -->
 </ul>
 <p>This HDF5 address space is generally referred to as an <em>HDF5 file</em> 
 regardless of its organization at the storage level. </p>

<p>HDF5 employs an extremely flexible mechanism called the 
 <em>virtual file layer</em>, or VFL, for file I/O.  
 A full understanding of the VFL is only necessary if you plan to write 
 your own drivers (see &ldquo;Virtual File Layer&rdquo;
 and &ldquo;List of VFL Functions&rdquo; in the 
 <a href="../TechNotes.html" target="RMwindow">
 <cite>HDF5 Technical Notes</cite></a>). For our purposes here, it is 
 sufficient to know that the low-level drivers used for file I/O 
 reside in the VFL, as illustrated in the following figure.
 Note that <code>H5FD_STREAM</code> is not available with 1.8.x 
 and later versions of the library.</p>


 
<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="center">
        <hr color="green" size="3"/>
        <img src="Images/VFL_Drivers.jpg">
        </td></tr>
<tr><td><hr color="green" size="1" /></td></tr>
<tr valign="top">
    <td align="left" >
        <b>Figure 2. I/O path from application 
        through VFL and low-level drivers to storage</b>
        <hr color="green" size="3"/></td></tr>
</table>
<br />

<p>As mentioned above, HDF5 applications access HDF5 files through 
 various <em>low-level file drivers</em>. 
 The default driver for that layout is the POSIX driver (also known 
 as the SEC2 driver), <code>H5FD_SEC2</code>. Alternative layouts and 
 drivers are designed to suit the needs of a variety of systems, 
 environments, and applications. The drivers are listed in the table below.
 </p>

<!-- NEW PAGE -->


<!-- 
<p>??????? php include statement for Table 2. Supported file drivers
??????? </p>
-->
<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="7" align="left" valign="bottom">
        <b>Table 2. Supported file drivers</b></td>
        </tr>

<?php include("../_topic/DriversTable.htm"); ?> 
 
</table>
 
 

  <p>For more information, see the 
  <a href="../RM/RM_H5Front.html" target="RMwindow"><cite>HDF5 Reference 
  Manual</cite></a> entries for the function calls shown in the column on 
  the right in the table above. </p>

  <p>Note that the low-level file drivers manage alternative <i>file</i> 
  storage layouts. <i>Dataset</i> storage layouts (chunking, 
  compression, and external dataset storage) are managed independently 
  of file storage layouts. </p>

  <p>If an application requires a special-purpose low-level driver,
  the VFL provides a public API for creating one.
  For more information on how to create a driver, 
  see &ldquo;Virtual File Layer&rdquo;
  and &ldquo;List of VFL Functions&rdquo; in the 
  <a href="../TechNotes.html" target="RMwindow"><cite>HDF5 Technical 
  Notes</cite></a>.</p>


<!-- NEW PAGE -->
<h4>3.8.1. Identifying the Previously-used File Driver</h4>

<p>When creating a new HDF5 file, no history exists, so the 
 file driver must be specified if it is to be other than the default.</p>

<p>When opening existing files, however, the application may need 
 to determine which low-level driver was used to create the file.
 The function <code>H5Pget_driver</code> is used for this purpose. 
 See the example below.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  hid_t H5Pget_driver (hid_t <em>fapl_id</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 5. Identifying a driver</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

<p><code>H5Pget_driver</code> returns a constant identifying the 
 low-level driver for the access property list <em>fapl_id</em>. 
 For example, if the file was created with the POSIX (aka SEC2) 
 driver, <code>H5Pget_driver</code> returns <code>H5FD_SEC2</code>.</p>

<p>If the application opens an HDF5 file without both determining 
 the driver used to create the file and setting up the use of that 
 driver, the HDF5 Library will examine the superblock and the 
 driver definition block to identify the driver.  
 See the <cite><a href="../H5.format.html" 
 target="FFSwindow">HDF5 File Format Specification</a></cite> 
 for detailed descriptions of the superblock and the driver definition 
 block.</p>


<h4>3.8.2. The POSIX (aka SEC2) Driver</h4>

  <p>The POSIX driver, <code>H5FD_SEC2</code>, uses functions from 
  section 2 of the POSIX manual to access unbuffered files stored on 
  a local file system. This driver is also known as the SEC2 driver. 
  The HDF5 Library buffers metadata regardless of the low-level driver, 
  but using this driver prevents data from being buffered again by the 
  lowest layers of the library.</p>

  <p>The function <code>H5Pset_fapl_sec2</code> sets the file access 
   properties to use the POSIX driver. See the example below.</p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_sec2 (hid_t <em>fapl_id</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 6. Using the POSIX, aka SEC2, driver</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>Any previously-defined driver properties are erased from the property 
  list.</p>

  <p>Additional parameters may be added to this function in the future. 
  Since there are no additional variable settings associated with 
  the POSIX driver, there is no <code>H5Pget_fapl_sec2</code> function.</p>


  
<h4>3.8.3. The Direct Driver</h4>

  <p>The Direct driver, <code>H5FD_DIRECT</code>, functions like the 
  POSIX driver except that data is written to or read from the file 
  synchronously without being cached by the system.</p>

  <p>The functions <code>H5Pset_fapl_direct</code> and 
  <code>H5Pget_fapl_direct</code> are used to manage file access properties. 
  See the example below.</p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_direct( hid_t <i>fapl_id</i>, size_t <i>alignment</i>, 
        size_t <i>block_size</i>, size_t <i>cbuf_size</i> )

  herr_t H5Pget_fapl_direct( hid_t <i>fapl_id</i>, size_t <i>*alignment</i>, 
        size_t <i>*block_size</i>, size_t <i>*cbuf_size</i> )</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 7. Using the Direct driver</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p><code>H5Pset_fapl_direct</code> sets the file access properties 
  to use the Direct driver; any previously defined driver properties 
  are erased from the property list. <code>H5Pget_fapl_direct</code> 
  retrieves the file access properties used with the Direct driver. 
  <code>fapl_id</code> is the file access property list identifier. 
  <code>alignment</code> is the memory alignment boundary. 
  <code>block_size</code> is the file system block size. 
  <code>cbuf_size</code> is the copy buffer size.</p>

  <p>Additional parameters may be added to this function in the future. </p>



<h4>3.8.4. The Log Driver</h4>

<p>The Log driver, <code>H5FD_LOG</code>, is 
 designed for situations where it is necessary to log file access activity.</p>

<p>The function <code>H5Pset_fapl_log</code> is used to manage
 logging properties. See the example below.</p>
 

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_log (hid_t <em>fapl_id</em>, const char *<em>logfile</em>,
           unsigned int <em>flags</em>, size_t <em>buf_size</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 8. Logging file access</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p><code>H5Pset_fapl_log</code> sets the file access property list 
  to use the Log driver. File access characteristics are identical to 
  access via the POSIX driver. Any previously defined driver properties 
  are erased from the property list. </p>

  <p>Log records are written to the file <code><em>logfile</em></code>.</p>

  <p>The logging levels set with the <code><em>verbosity</em></code> 
  parameter are shown in the table below. </p>

<table width="600" cellspacing="0" align="center" cellpadding="0">
    <tr valign="bottom">
        <td colspan="2" align="left" valign="bottom">
        <b>Table 3. Logging levels</b></td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="3" /></td></tr>
    <tr valign="top"> 
        <td width="10%"><b>Level</b></td>
        <td width="90%"><b>Comments</b></td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top"> 
        <td>0</td>
        <td>Performs no logging.</td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top"> 
        <td>1</td>
        <td>Records where writes and reads occur in the file.</td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="1" /></td></tr>
    <tr valign="top"> 
        <td>2</td>
        <td>Records where writes and reads occur in the file and what 
        kind of data is written at each location. This includes raw 
        data or any of several types of metadata (object headers, 
        superblock, B-tree data, local headers, or global headers).</td>
        </tr>
    <tr><td colspan="2"><hr color="green" size="3" /></td></tr>
</table>
<br />

<p>There is no <code>H5Pget_fapl_log</code> function.</p>

<p>Additional parameters may be added to this function in the future. </p>



<h4>3.8.5. The Windows Driver</h4>

  <p>The Windows driver, <code>H5FD_WINDOWS</code>, was modified in 
  HDF5-1.8.8 to be a wrapper of the POSIX driver, <code>H5FD_SEC2</code>. 
  In other words, if the Windows drivers is used, any file I/O will 
  instead use the functionality of the POSIX driver. This change should 
  be transparent to all user applications. The Windows driver used to be 
  the default driver for Windows systems. The POSIX driver is now the 
  default. </p>

  <p>The function <code>H5Pset_fapl_windows</code> sets the file access 
   properties to use the Windows driver. See the example below.</p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_windows (hid_t <em>fapl_id</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 9. Using the Windows driver</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>Any previously-defined driver properties are erased from the property 
  list.</p>

  <p>Additional parameters may be added to this function in the future. 
  Since there are no additional variable settings associated with 
  the POSIX driver, there is no <code>H5Pget_fapl_windows</code> function.</p>



<h4>3.8.6. The STDIO Driver</h4>

  <p>The STDIO driver, <code>H5FD_STDIO</code>, accesses permanent files 
  in a local file system like the POSIX driver does. The STDIO driver also 
  has an additional layer of buffering beneath the HDF5 Library. </p>

  <p>The function <code>H5Pset_fapl_stdio</code> sets the file access 
  properties to use the STDIO driver. See the example below.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_stdio (hid_t <em>fapl_id</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 10. Using the STDIO driver</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>Any previously defined driver properties are erased from the property 
  list.</p>

  <p>Additional parameters may be added to this function in the future. 
  Since there are no additional variable settings associated with 
  the STDIO driver, there is no <code>H5Pget_fapl_stdio</code> function.</p>

  
  
<h4>3.8.7. The Memory (aka Core) Driver</h4>

<p>There are several situations in which it is reasonable, 
 sometimes even required, to maintain a file entirely in system memory.
 You might want to do so if, for example, either of the following 
 conditions apply:</p>
 <ul>
    <li>Performance requirements are so stringent that 
        disk latency is a limiting factor</li>
    <li>You are working with small, temporary files that will not 
        be retained and, thus, need not be written to storage media</li>
 </ul>

  <p>The Memory driver, <code>H5FD_CORE</code>, provides a mechanism 
  for creating and managing such in-memory files. The functions 
  <code>H5Pset_fapl_core</code> and <code>H5Pget_fapl_core</code> 
  manage file access properties. See the example below.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_core (hid_t <em>access_properties</em>, 
           size_t <em>block_size</em>, hbool_t <em>backing_store</em>)
  herr_t H5Pget_fapl_core (hid_t <em>access_properties</em>, 
           size_t *<em>block_size</em>), hbool_t *<em>backing_store</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 11. Managing file access for in-memory files</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p><code>H5Pset_fapl_core</code> sets the file access property list
  to use the Memory driver; any previously defined driver properties 
  are erased from the property list. </p>
 
  <p>Memory for the file will always be allocated in units of the 
  specified <code><em>block_size</em></code>. </p>


  <p>The <code><em>backing_store</em></code> Boolean flag is set when 
  the in-memory file is created. <code><em>backing_store</em></code> 
  indicates whether to write the file contents to disk when the file 
  is closed. If <code><em>backing_store</em></code> is set to 1 (TRUE), 
  the file contents are flushed to a file with the same name as the 
  in-memory file when the file is closed or access to the file is 
  terminated in memory. If <code><em>backing_store</em></code> is set 
  to 0 (FALSE), the file is not saved.</p>
  
  <p>The application is allowed to open an existing file with the 
  <code><em>H5FD_CORE</em></code> driver.  While using 
  <code><em>H5Fopen</em></code> to open an existing file, if 
  <code><em>backing_store</em></code> is set to <code><em>1</em></code> 
  and the <code><em>flag</em></code> for <code><em>H5Fopen</em></code>
  is set to <code><em>H5F_ACC_RDWR</em></code>, changes to the file 
  contents will be saved to the file when the file is closed.  If 
  <code><em>backing_store</em></code> is set to <code><em>0</em></code> 
  and the <code><em>flag</em></code> for <code><em>H5Fopen</em></code> 
  is set to <code><em>H5F_ACC_RDWR</em></code>, changes to the file 
  contents will be lost when the file is closed.  If the 
  <code><em>flag</em></code> for <code><em>H5Fopen</em></code> is set to 
  <code><em>H5F_ACC_RDONLY</em></code>, no change to the file will be allowed 
  either in memory or on file.</p>

  <p>If the file access property list is set to use the Memory driver, 
  <code>H5Pget_fapl_core</code> will return <code><em>block_size</em></code> 
  and <code><em>backing_store</em></code> with the relevant file access 
  property settings.</p>

<p>Note the following important points regarding in-memory files:</p>
    <ul>
    <li>Local temporary files are created and accessed directly 
        from memory without ever being written to disk</li>
    <li>Total file size must not exceed the available virtual memory</li>
    <li>Only one HDF5 file identifier can be opened for the file, the 
        identifier returned by <code>H5Fcreate</code> or 
        <code>H5Fopen</code></li>
    <li>The changes to the file will be discarded when access is 
        terminated unless <code><em>backing_store</em></code> is set 
        to <code>1</code></li>
    </ul>

<p>Additional parameters may be added to these functions in the future. </p>

<p>See the &ldquo;<a href=
"../Advanced/FileImageOperations/HDF5FileImageOperations.pdf">HDF5 
File Image Operations</a>&rdquo; section for information on more 
advanced usage of the Memory file driver, and see the 
&ldquo;<a href=
"../Advanced/ModifiedRegionWrites/ModifiedRegionWrites.pdf">
Modified Region Writes</a>&rdquo; section for information on how to 
set write operations so that only modified regions are written to 
storage.
</p>


<h4>3.8.8. The Family Driver</h4>

  <p>HDF5 files can become quite large, and this can create problems on 
  systems that do not support files larger than 2 gigabytes.
  The HDF5 <b><i>file family</i></b> mechanism 
  is designed to solve the problems this creates by splitting 
  the HDF5 file address space across several smaller files.  
  This structure does not affect how metadata and raw data are stored:
  they are mixed in the address space just as they would be in a 
  single, contiguous file.</p>

  <p>HDF5 applications access a family of files via the 
  Family driver, <code>H5FD_FAMILY</code>. The functions 
  <code>H5Pset_fapl_family</code> and <code>H5Pget_fapl_family</code> 
  are used to manage file family properties. See the example below.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_family (hid_t <em>fapl_id</em>, hsize_t <em>memb_size</em>, 
        hid_t <em>member_properties</em>)

  herr_t H5Pget_fapl_family (hid_t <em>fapl_id</em>, hsize_t *<em>memb_size</em>, 
        hid_t *<em>member_properties</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 12. Managing file family properties</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>Each member of the family is the same <i>logical</i> size though 
  the size and disk storage reported by file system listing tools may be 
  substantially smaller. Examples of file system listing tools are 
  <code>&rsquo;ls -l&rsquo;</code> on a Unix system or the detailed folder 
  listing on an Apple Macintosh or Microsoft Windows system.
  The name passed to <code>H5Fcreate</code> or <code>H5Fopen</code> 
  should include a <code>printf(3c)</code>-style integer format specifier 
  which will be replaced with the family member number.
  The first family member is numbered zero (<code>0</code>). </p>

<!-- NEW PAGE -->
  <p><code>H5Pset_fapl_family</code> sets the access properties to use 
  the Family driver; any previously defined driver properties are erased 
  from the property list. <code><em>member_properties</em></code> will 
  serve as the file access property list for each member of the file family.
  <code><em>memb_size</em></code> specifies the logical size, in bytes,
  of each family member. <code><em>memb_size</em></code> is used only 
  when creating a new file or truncating an existing file; otherwise 
  the member size is determined by the size of the first member of the 
  family being opened. Note: If the size of the <code>off_t</code> 
  type is four bytes, the maximum family member size is usually 
  2^31-1 because the byte at offset 2,147,483,647 is generally inaccessible. </p>

  <p><code>H5Pget_fapl_family</code> is used to retrieve file family 
  properties. If the file access property list is set to use the 
  Family driver, <em>member_properties</em> will be returned with a 
  pointer to a copy of the appropriate member access property list.
  If <code><em>memb_size</em></code> is non-null, it will contain 
  the logical size, in bytes, of family members. </p>

  <p>Additional parameters may be added to these functions in the future. </p>


<h4>Unix Tools and an HDF5 Utility</h4>

  <p>It occasionally becomes necessary to <b>repartition</b> a file family.
  A command-line utility for this purpose, <code>h5repart</code>, is 
  distributed with the HDF5 Library.</p>

 <dl>
    <dd><code>h5repart</code> [<code>-v</code>] 
        [<code>-b</code> <em>block_size</em>[<em>suffix</em>]] 
        [<code>-m</code> <em>member_size</em>[<em>suffix</em>]] 
        <em>source destination</em> 
 </dl>

  <p><code>h5repart</code> repartitions an HDF5 file by copying the source file 
  or file family to the destination file or file family, preserving holes 
  in the underlying UNIX files. Families are used for the source and/or 
  destination if the name includes a <code>printf</code>-style integer 
  format such as <code>%d</code>.  
  The <code>-v</code> switch prints input and output file names on the 
  standard error stream for progress monitoring, 
  <code>-b</code> sets the I/O block size (the default is 1KB), and 
  <code>-m</code> sets the output member size if the destination is a 
  family name (the default is 1GB).  
  <code><em>block_size</em></code> and <code><em>member_size</em></code>
  may be suffixed with the letters <code>g</code>, <code>m</code>, or 
  <code>k</code> for GB, MB, or KB respectively. </p>

  <p>The <code>h5repart</code> utility is described on the 
  <a href="../RM/Tools.html" target="RMwindow">Tools</a> page of the 
  <a href="../RM/RM_H5Front.html" target="RMwindow">
  <cite>HDF5 Reference Manual</cite></a>.</p>

  <p>An existing HDF5 file can be split into a family of files by running
  the file through <code>split(1)</code> on a UNIX system and numbering 
  the output files. However, the HDF5 Library is lazy about extending 
  the size of family members, so a valid file cannot generally be 
  created by concatenation of the family members. </p>

  <p>Splitting the file and rejoining the segments by concatenation
  (<code>split(1)</code> and <code>cat(1)</code> on UNIX systems)
  does not generate files with holes; holes are preserved only through 
  the use of <code>h5repart</code>. </p>

  
  
  
  
<!-- NEW PAGE -->
<h4>3.8.9. The Multi Driver</h4>

  <p>In some circumstances, it is useful to separate metadata from 
  raw data and some types of metadata from other types of metadata. 
  Situations that would benefit from use of the Multi driver include 
  the following:</p>
  <ul>
    <li>In networked situations where the small metadata files 
      can be kept on local disks but larger raw data files 
      must be stored on remote media</li>
    <li>In cases where the raw data is extremely large</li>
    <li>In situations requiring frequent access to metadata held
      in RAM while the raw data can be efficiently held on disk</li>
  </ul>
  <p>In either case, access to the metadata is substantially 
  easier with the smaller, and possibly more localized, metadata files.
  This often results in improved application performance.</p>

  <p>The Multi driver, <code>H5FD_MULTI</code>, provides a mechanism 
  for segregating raw data and different types of metadata into multiple 
  files. The functions <code>H5Pset_fapl_multi</code> and 
  <code>H5Pget_fapl_multi</code> are used to manage access properties 
  for these multiple files. See the example below.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_multi (hid_t <em>fapl_id</em>, const H5FD_mem_t *<em>memb_map</em>,
            const hid_t *<em>memb_fapl</em>, const char * const *<em>memb_name</em>,
            const haddr_t *<em>memb_addr</em>, hbool_t <em>relax</em>)
  herr_t H5Pget_fapl_multi (hid_t <em>fapl_id</em>, const H5FD_mem_t *<em>memb_map</em>,
            const hid_t *<em>memb_fapl</em>, const char **<em>memb_name</em>,
            const haddr_t *<em>memb_addr</em>, hbool_t *<em>relax</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 13. Managing access properties for multiple files</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p><code>H5Pset_fapl_multi</code> sets the file access properties 
  to use the Multi driver; any previously defined driver properties are 
  erased from the property list. With the Multi driver invoked, the 
  application will provide a base name to <code>H5Fopen</code> or 
  <code>H5Fcreate</code>. The files will be named by that base name as 
  modified by the rule indicated in <code><em>memb_name</em></code>.
  File access will be governed by the file access property list 
  <code><em>memb_properties</em></code>. </p>

  <p>See 
  <a href="../RM/RM_H5P.html#Property-SetFaplMulti"
  target="RMwindow"><code>H5Pset_fapl_multi</code></a>  and
  <a href="../RM/RM_H5P.html#Property-GetFaplMulti"
  target="RMwindow"><code>H5Pget_fapl_multi</code></a>  
  in the <cite>HDF5 Reference Manual</cite> for descriptions 
  of these functions and their usage.</p>

  <p>Additional parameters may be added to these functions in the future. </p>


<h4>3.8.10. The Split Driver</h4>

  <p>The Split driver, <code>H5FD_SPLIT</code>, is a limited case of the 
  Multi driver where only two files are created. One file holds metadata, 
  and the other file holds raw data. </p>

  <p>The function <code>H5Pset_fapl_split</code> is used to manage Split 
  file access properties. See the example below.</p>

<!-- NEW PAGE -->
<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_split (hid_t <em>access_properties</em>, 
      const char *<em>meta_extension</em>, hid_t <em>meta_properties</em>, 
      const char *<em>raw_extension</em>, hid_t <em>raw_properties</em></pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 14. Managing access properties for split files</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p><code>H5Pset_fapl_split</code> sets the file access properties 
  to use the Split driver; any previously defined driver properties 
  are erased from the property list. </p>


  <p>With the Split driver invoked, the application will provide a base 
  file name such as <code><em>file_name</em></code> to 
  <code>H5Fcreate</code> or <code>H5Fopen</code>. The metadata and raw 
  data files in storage will then be named 
  <code><em>file_name.meta_extension</em></code> and 
  <code><em>file_name.raw_extension</em></code>, respectively. For 
  example, if <code><em>meta_extension</em></code> is defined as 
  <code>.meta</code> and <code><em>raw_extension</em></code> is defined 
  as <code>.raw</code>, the final filenames will be 
  <code><em>file_name</em>.meta</code> and 
  <code><em>file_name</em>.raw</code>.</p>

  <p>Each file can have its own file access property list. 
  This allows the creative use of other low-level file drivers.
  For instance, the metadata file can be held in RAM and accessed 
  via the Memory driver while the raw data file is stored on disk and 
  accessed via the POSIX driver. Metadata file access will be governed 
  by the file access property list in <em>meta_properties</em>. 
  Raw data file access will be governed by the file access property
  list in <em>raw_properties</em>. </p>

  <p>Additional parameters may be added to these functions in the future. 
  Since there are no additional variable settings associated with 
  the Split driver, there is no <code>H5Pget_fapl_split</code> function.</p>



<h4>3.8.11. The Parallel Driver</h4>

  <p>Parallel environments require a parallel low-level driver. HDF5&rsquo;s 
  default driver for parallel systems is called the Parallel driver, 
  <code>H5FD_MPIO</code>. This driver uses the MPI standard for both 
  communication and file I/O.</p>

  <p>The functions <code>H5Pset_fapl_mpio</code> and 
  <code>H5Pget_fapl_mpio</code> are used to manage file access properties 
  for the <code>H5FD_MPIO</code> driver. See the example below.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_mpio (hid_t <em>fapl_id</em>, MPI_Comm <em>comm</em>, 
           MPI_info <em>info</em>)
  herr_t H5Pget_fapl_mpio (hid_t <em>fapl_id</em>, MPI_Comm *<em>comm</em>, 
           MPI_info *<em>info</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 15. Managing parallel file access properties</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>The file access properties managed by <code>H5Pset_fapl_mpio</code> 
  and retrieved by <code>H5Pget_fapl_mpio</code> are 
  the MPI communicator, <code><em>comm</em></code>, and
  the MPI info object, <code><em>info</em></code>. <code>comm</code> 
  and <code>info</code> are used for file open. <code>info</code> is an 
  information object much like an HDF5 property list. Both are defined 
  in <code>MPI_FILE_OPEN</code> of MPI-2. </p>

  <p>The communicator and the info object are saved in the file access 
  property list <code><em>fapl_id</em></code>.
  <code><em>fapl_id</em></code> can then be passed to 
  <code>MPI_FILE_OPEN</code> to create and/or open the file. </p>

  <p><code>H5Pset_fapl_mpio</code> and <code>H5Pget_fapl_mpio</code> 
  are available only in the parallel HDF5 Library and are not collective 
  functions. The Parallel driver is available only in 
  the parallel HDF5 Library.</p>

  <p>Additional parameters may be added to these functions in the future. </p>


<!-- as of 3.24.2014, the parallel posix driver, mpi-posix, is no longer 
available.
<h4>3.8.12. The Parallel POSIX Driver</h4>

  <p>In addition to the Parallel driver, <code>H5FD_MPIO</code>, HDF5 
  has the Parallel POSIX driver, <code>H5FD_MPIPOSIX</code>. This Parallel 
  POSIX driver uses MPI for communication and POSIX file-system calls 
  for file I/O.</p>

  <p>The functions <code>H5Pset_fapl_mpiposix</code> and 
  <code>H5Pget_fapl_mpiposix</code> are used to manage file access properties 
  for the <code>H5FD_MPIPOSIX</code> driver. See the example below.</p>


<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  herr_t H5Pset_fapl_mpiposix (hid_t <em>fapl_id</em>, MPI_Comm <em>comm</em>, 
        hbool_t <em>use_gpfs_hints</em>)

  herr_t H5Pget_fapl_mpiposix (hid_t <em>fapl_id</em>, MPI_Comm *<em>comm</em>, 
        hbool_t *<em>use_gpfs_hints</em>)</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 16. Managing parallel POSIX file access properties</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

  <p>The file access properties managed 
  by <code>H5Pset_fapl_mpiposix</code> and retrieved by 
  <code>H5Pget_fapl_mpiposix</code> are the MPI communicator, 
  <code><em>comm</em></code>, and the parameter 
  <code><em>use_gpfs_hints</em></code>. <code><em>comm</em></code> and 
  <code><em>use_gpfs_hints</em></code> are used for file 
  open. <code><em>comm</em></code> is defined in <code>MPI_FILE_OPEN</code> of MPI-2. 
  </p>

  <p>The <code><em>comm</em></code> and the 
  <code><em>use_gpfs_hints</em></code> parameter values 
  are saved in the file access property list <code><em>fapl_id</em></code>.
  </p>

  <p>
  <code>H5Pset_fapl_mpiposix</code> and <code>H5Pget_fapl_mpiposix</code> 
  are available only in the parallel HDF5 Library and are not collective 
  functions. The Parallel POSIX driver is available only in 
  the parallel HDF5 Library.</p>

  <p>Additional parameters may be added to these functions in the future. </p>
-->
<br />


<!-- re-insert printing page break header here -->
<!--
                     STREAM DRIVER REMOVED FROM HDF5 
                       DECEMBER 2007/RELEASE 1.8.0
                        DUE TO LICENSING CONCERNS	

<h4>8.9 Streaming I/O -- 
    <span class="smallcaps">STREAM</span> driver</h4>


<p>The <span class="smallcaps">STREAM</span> driver is designed 
 for situations where data is to be streamed across the network 
 rather than written to a local file.

<p>The functions <code>H5Pset_fapl_stream</code> and
 <code>H5Pget_fapl_stream</code> are used to manage 
 streaming file access properties: 

 <dl>
    <dd><code>herr_t H5Pset_fapl_stream (hid_t <em>fapl_id</em>,
                     H5FD_stream_fapl_t *<em>fapl</em>)</code>
    <dd><code>herr_t H5Pget_fapl_stream (hid_t <em>fapl_id</em>,
                     H5FD_stream_fapl_t *<em>fapl</em>)</code>
 </dl>

<p><code>H5Pset_fapl_stream</code> sets up the use of the 
 <span class="smallcaps">STREAM</span> driver.

<p><code><em>fapl_id</em></code> is the identifier for the 
 file access property list currently in use.

<p><code><em>fapl</em></code> is the streaming file access property list
 and is an <code>H5FD_stream_fapl_t</code> struct containing the 
 following elements:

 <div align="center">
   <table border="0">
     <tr align="left">
       <td><code>size_t</code></td>
       <td><code><em>increment</em></code></td></tr>
     <tr align="left">
       <td><code>H5FD_STREAM_SOCKET_TYPE&nbsp;</code></td>
       <td><code><em>socket</em></code></td></tr>
     <tr align="left">
       <td><code>hbool_t</code></td>
       <td><code><em>do_socket_io</em></code></td></tr>
     <tr align="left">
       <td><code>unsigned int</code></td>
       <td><code><em>backlog</em></code></td></tr>
     <tr align="left">
       <td><code>H5FD_stream_broadcast_t&nbsp;</code></td>
       <td><code><em>broadcast_fn</em></code></td></tr>
     <tr align="left">
       <td><code>void *</code></td>
       <td><code><em>broadcast_arg</em></code></td></tr>
   </table>
 </div>

 <ul>
   <li><code><em>increment</em></code> specifies how much memory 
     to allocate each time additional memory is required.  
   <li><code><em>socket</em></code> is an external socket descriptor;
     if a valid socket argument is provided, that socket will be used.
   <li><code><em>do_socket_io</em></code> is a boolean value specifying 
     whether to perform I/O on <code><em>socket</em></code>.
   <li><code><em>backlog</em></code> is the argument for the 
     <code>listen</code> call.
   <li><code><em>broadcast_fn</em></code> is the broadcast callback 
     function.
   <li><code><em>broadcast_arg</em></code> is the user argument to 
     the broadcast callback function.
 </ul>

<p><code>H5Pget_fapl_stream</code> retrieves the values stored in
 the <code><em>fapl</em></code> struct.

<p><code>H5Pset_fapl_stream</code> and <code>H5Pget_fapl_stream</code> 
 are not intended for use in parallel environments.

-->


<SCRIPT language="JavaScript">
<!--
document.writeln ("
<a name="Examples">
<div align="right">
<a href="#TOP"><font size="-1">(Top)</font></a>
</div>
</a>
");
-->
</SCRIPT>


<a name="Examples">
<h3 class="pagebefore">3.9. Code Examples for Opening and Closing Files</h3>
</a>

<!-- editingComment
<p class=editingcomment>[ [ [ Comprehensive example set yet to be prepared. ] ] ]</p>
-->
<br />

<h4>3.9.1. Example Using the <code>H5F_ACC_TRUNC</code> Flag</h4>

<p>The following example uses the <code>H5F_ACC_TRUNC</code> flag when it 
 creates a new file. The default file creation and file access properties
 are also used. Using <code>H5F_ACC_TRUNC</code> means the function 
 will look for an existing file with the name specified by the function. 
 In this case, that name is <code>FILE</code>. If the function does not 
 find an existing file, it will create one. If it does find an existing 
 file, it will empty the file in preparation for a new set of data. 
 The identifier for the "new" file will be passed back to the application 
 program. See the "<a href="#FileAccessModes">File Access Modes</a>" 
 section for more information.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  hid_t file;                                     /*  identifier   */
  
  /* Create a new file using H5F_ACC_TRUNC access, default file 
   * creation properties, and default file access properties.      */
  file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
  
  /* Close the file.                                               */
  status = H5Fclose(file);</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 17. Creating a file with default creation and 
        access properties</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

<h4>3.9.2. Example with the File Creation Property List</h4>

<p>The example below shows how to create a file with 64-bit object 
offsets and lengths.</p>



<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  hid_t create_plist;
  hid_t file_id;
  create_plist = H5Pcreate(H5P_FILE_CREATE);
  H5Pset_sizes(create_plist, 8, 8);
  file_id = H5Fcreate(&quot;test.h5&quot;, H5F_ACC_TRUNC,
                      create_plist, H5P_DEFAULT);
      .
      .
      .
  H5Fclose(file_id);</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 18. Creating a file with 64-bit offsets</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />

<!-- NEW PAGE -->
<h4>3.9.3. Example with File Access Property List</h4>

<p>This example shows how to open an existing file for independent datasets 
 access by MPI parallel I/O:</p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  hid_t access_plist;
  hid_t file_id;
  access_plist = H5Pcreate(H5P_FILE_ACCESS);
  H5Pset_fapl_mpi(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL);
  
  /* H5Fopen must be called collectively */
  file_id = H5Fopen(&quot;test.h5&quot;, H5F_ACC_RDWR, access_plist); 
     .
     .
     .
  /* H5Fclose must be called collectively */
  H5Fclose(file_id);</pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>
    <tr valign="top">
        <td align="left">
        <b>Example 19. Opening an existing file for parallel I/O</b>
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />



<a name="MountingFiles">
<h3>3.10. Working with Multiple HDF5 Files</h3>
</a>
<p>Multiple HDF5 files can be associated so that the files can be worked 
with as though all the information is in a single HDF5 file. A temporary 
association can be set up by means of the <code>H5Fmount</code> function. 
A permanent association can be set up by means of the external link 
function <code>H5Lcreate_external</code>. </p>

<p>The purpose of this section is to describe what happens when the 
<code>H5Fmount</code> function is used to mount one file on another. </p>

<p>When a file is mounted on another, the mounted file is mounted at 
a group, and the root group of the mounted file takes the place of that 
group until the mounted file is unmounted or until the files are closed. </p>

<p>The figure below shows two files before one is mounted on the other. 
File1 has two groups and three datasets. The group that is the target of 
the A link has links, Z and Y, to two of the datasets. The group that is 
the target of the B link has a link, W, to the other dataset. File2 has 
three groups and three datasets. The groups in File2 are the targets of 
the AA, BB, and CC links. The datasets in File2 are the targets of the 
ZZ, YY, and WW links. </p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="center">
        <hr color="green" size="3"/>
        <img height="300"src="Images/Files_fig3.JPG">
        </td></tr>
<tr><td><hr color="green" size="1" /></td></tr>
<tr valign="top">
    <td align="left" >
        <b>Figure 3. Two separate files</b>
        <hr color="green" size="3"/></td></tr>
</table>
<br />



<p>The figure below shows the two files after File2 has been mounted 
File1 at the group that is the target of the B link.</p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="center">
        <hr color="green" size="3"/>
        <img height="300" src="Images/Files_fig4.JPG">
        </td></tr>
<tr><td><hr color="green" size="1" /></td></tr>
<tr valign="top">
    <td align="left" >
        <b>Figure 4. File2 mounted on File1 </b>

        <hr color="green" size="3"/></td></tr>
</table>
<br />



<p>Note that the dataset that is the target of the W link is not shown 
in the figure above. That dataset is masked by the mounted file. </p>

<p>If a file is mounted on a group that has members, those members are 
hidden until the mounted file is unmounted. There are two ways around this 
if you need to work with a group member. One is to mount the file on an 
empty group. Another is to open the group member before you mount the 
file. Opening the group member will return an identifier that you can 
use to locate the group member. </p>

<p>The example below shows how <code>H5Fmount</code> might be used to 
mount File2 onto File1. </p>

<table width="600" cellspacing="0" align="center">
    <tr valign="top"> 
        <td align="left">
        <hr color="green" size="3"/>
    <pre>
  status = H5Fmount(loc_id, "/B", child_id, plist_id) </pre></td>
        </tr>
    <tr><td><hr color="green" size="1" /></td></tr>

    <tr valign="top">
        <td align="left">
        <b>Example 20.Using <code>H5Fmount</code> </b><br />
        loc_id is the file identifier for File1, /B is the link path to the 
        group where File2 is mounted, child_id is the file identifier 
        for File2, and plist_id is a property list identifier.
        <hr color="green" size="3"/></td>
        </tr>
</table>
<br />



<p>For more information, see the 
&ldquo;<a href="09_Groups.html">HDF5 Groups</a>&rdquo; chapter, and the 
<code>H5Fmount</code>, <code>H5Funmount</code>, and 
<code>H5Lcreate_external</code> functions in the 
<a href="../RM/RM_H5Front.html"><cite>HDF5 Reference Manual</cite></a>.</p>






<br /><br />
</body>
</html>