Direct I/O to Memory Files (C)

Use memory files to reduce disk I/O during program execution. Memory files differ from the other file types only in that they are temporary files that reside in memory. You can write to and read from a memory file just as you do with a disk file.

You must specify the /Sv compiler option to use memory files.

You can create a memory file in two ways:

You must specify the /Sh compiler option to use ddnames.

Once a memory file has been created, it can be accessed by the module that created it as well as by any other function within the same process. The memory file remains accessible until the file is removed by the remove function or until the program has terminated.

You can request that the temporary files created by the tmpfile function be either disk files or memory files. By default, tmpfile creates disk files. To have temporary files created as memory files, set the TEMPMEM environment variable to ON:

   SET TEMPMEM=on 

The word "on" can be in any case. You must still specify the memoryfiles Language Option.

Memory File Restrictions and Considerations



Stream Processing


Redirect Standard Streams
Open Streams Using Data Definition Names