Performing Memory File I/O Operations

This chapter describes how to perform memory file I/O operations.

LE/VSE C Run-Time supports files known as memory files. Memory files are temporary work files that are stored in main memory rather than in external storage.

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, LE/VSE C Run-Time 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.

See LE/VSE C Run-Time Support for the Double-Byte Character Set (DBCS) for information about using wide-character I/O with LE/VSE C Run-Time.