Mark file as read-only

ss_file_readonly is a function defined in ssfile.c.

Synopsis:

herr_t ss_file_readonly(ss_file_t *file)

Description: A file can be marked as read-only even after it is opened for read-write. This is often useful when a file is created since a read-only file results in certain optimizations (such as knowing that such a file is always in a synchronized state). Marking a file as read-only can be substantially faster than closing the file and then reopening it since no I/O needs to happen.

The file should be in a synchronized state before this function is called.

Return Value: Returns non-negative on success; negative on failure.

Parallel Notes: Collective across the file’s communicator.

Issues: It would be nice if HDF5 had a similar function, which would add an extra level of error checking to prevent SSlib from accidently writing to the HDF5 file after it was marked as read-only.

See Also:

  • Files: Introduction for current chapter