Performing memory file and hiperspace I/O operations

This topic describes how to perform memory file and hiperspace I/O operations. z/OS® XL C/C++ supports files known as memory files. Memory files are temporary work files that are stored in main memory rather than in external storage. There are two types of memory files:
Memory files can be written to, read from, and repositioned within like any other type of file. Memory files exist for the life of your root program, unless you explicitly delete them by using the remove() or clrmemf() functions. The root program is the first main() to be invoked. Any main() program called by a system() call is known as a child program. When the root program terminates, z/OS XL C/C++ removes memory files automatically. Memory files may give you better performance than other types of files.
Note: There may not be a one-to-one correspondence between the bytes in a memory file and the bytes in some other external representation of the file, such as a disk file. Applications that mix open modes on a file (for example, writing a file as text file and reading it back as binary) may not port readily from external I/O to memory file I/O.

This topic describes C I/O streams as they can be used within C++ programs. If you want to use the C++ I/O stream classes instead, see Using the Standard C++ Library I/O Stream Classes for general information. For more detailed information, see Standard C++ Library Reference, which discusses the Standard C++ I/O stream classes.