- int gd_metaflush(DIRFILE *dirfile);
Metadata is written to disk using the current Standards Version as stored in the dirfile object. See gd_dirfile_standards(3) to change or report the current Standards Version. If the dirfile metadata conforms to no known Standards Version, a Standards non-compliant fragment will be written.
This function flushes only metadata. To flush the field data as well, call gd_sync(3) instead.
RETURN VALUEOn success, zero is returned. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are:
- The supplied dirfile was opened in read-only mode.
- The library was unable to allocate memory.
- The supplied dirfile was invalid.
- An I/O error occurred while trying to write modified metadata to disk.
- While attempting to flush modified metadata to disk, a field specification line exceeded the maximum allowed length. On most platforms, the maximum length is at least 2**31 bytes, so this typically indicates something pathological happening.