1
2
3
4
5
6
7
8
9gd_metaflush(3) GETDATA gd_metaflush(3)
10
11
12
14 gd_metaflush — write modified Dirfile metadata to disk
15
16
18 #include <getdata.h>
19
20 int gd_metaflush(DIRFILE *dirfile);
21
22
24 The gd_metaflush() function flushes all pending metadata changes in the
25 dirfile specified by dirfile to disk. This is accomplished by re-writ‐
26 ing the format specification fragments containing modified metadata,
27 overwriting the existing files. Format file fragments which are un‐
28 changed are not touched.
29
30 Metadata is written to disk using the current Standards Version as
31 stored in the dirfile object. See gd_dirfile_standards(3) to change or
32 report the current Standards Version. If the dirfile metadata conforms
33 to no known Standards Version, a Standards non-compliant fragment will
34 be written.
35
36 This function flushes only metadata. To flush the field data as well,
37 call gd_sync(3) instead.
38
39
41 On success, zero is returned. On error, a negative-valued error code
42 is returned. Possible error codes are:
43
44 GD_E_ACCMODE
45 The supplied dirfile was opened in read-only mode.
46
47 GD_E_ALLOC
48 The library was unable to allocate memory.
49
50 GD_E_BAD_DIRFILE
51 The supplied dirfile was invalid.
52
53 GD_E_IO An I/O error occurred while trying to write modified metadata
54 to disk.
55
56 GD_E_LINE_TOO_LONG
57 While attempting to flush modified metadata to disk, a field
58 specification line exceeded the maximum allowed length. On
59 most platforms, the maximum length is at least 2**31 bytes, so
60 this typically indicates something pathological happening.
61
62 The error code is also stored in the DIRFILE object and may be re‐
63 trieved after this function returns by calling gd_error(3). A descrip‐
64 tive error string for the error may be obtained by calling
65 gd_error_string(3).
66
67
69 When writing metadata using Standards Version 4 or earlier, the refer‐
70 ence field may change, owing to the lack of a /REFERENCE directive. A
71 work-around is to upgrade to Standards Version 5 or later.
72
73
75 The dirfile_metaflush() function appeared in GetData-0.4.0.
76
77 In GetData-0.7.0, this function was renamed to gd_metaflush().
78
79 in GetData-0.10.0, the error return from this function changed from -1
80 to a negative-valued error code.
81
82
84 gd_close(3), gd_dirfile_standards(3), gd_error(3), gd_error_string(3),
85 gd_open(3), gd_rewrite_fragment(3), gd_sync(3)
86
87
88
89Version 0.10.0 25 December 2016 gd_metaflush(3)