File Input and Output APIs
File input and output APIs allow you to work with the contents of files in
hierarchical file systems. The APIs work with stream files,
which are files that have varying lengths and no conventional record structure.
Stream files are also called byte-stream files, or simply files. The file input
and output APIs are:
- Change File Pointer (QHFCHGFP) allows you to change the location of the current read/write position in the file.
- Close Stream File (QHFCLOSF) closes the specified stream file, releasing any locks on the file or ranges within the file.
- Force Buffered Data (QHFFRCSF) forces data from a buffer into nonvolatile storage.(Nonvolatile storageis any storage area whose contents are not lost when power is cut off or when the system is loaded.)
- Get Stream File Size (QHFGETSZ) returns the current size of a stream file's data, in bytes, as of the last write operation to the file.
- Lock and Unlock Range in Stream File (QHFLULSF) allows you to lock and unlock parts of files.
- Open Stream File (QHFOPNSF) opens and optionally creates a single stream file.
- Read from Stream File (QHFRDSF) reads a specified number of bytes from a stream file opened with an access mode of read only or read/write.
- Set Stream File Size (QHFSETSZ) sets the size of a stream file in bytes.
- Write to Stream File (QHFWRTSF) writes bytes to a stream file.