Writing to files

You can use the following library functions to write to a file. See z/OS XL C/C++ Runtime Library Reference for more information on these library functions.

The printf(), puts(), putchar(), and vprintf() functions write to stdout, which can be redirected to a memory or hiperspace memory file.

In hiperspace memory files, each library function causes your data to be moved into the buffer in your address space. The buffer is written to hiperspace each time it is filled, or each time you call the fflush() library function.

z/OS® XL C/C++ counts a call to a write function writing 0 bytes or or a write request that fails because of a system error as a write operation. For regular memory files, the only possible system error that can occur is an error in acquiring storage.