Opening Binary Stream Files (one character at a time) - IBM-ILE

To open an iSeries Data Management system file as a binary stream file for character-at-a-time processing, use fopen() with any of the following modes:

Opening Binary Stream Files (one character at a time)

Notes:

  1. The number of files that can be simultaneously opened by fopen() depends on the size of the system storage available.
  2. The fopen() function open modes also apply to the freopen() function.
  3. If the binary stream file contains deleted records, the deleted records are skipped by the binary stream I/O functions.

The valid keyword parameters are:

Opening Binary Stream Files (one character at a time)

If you specify the type parameter the value must be memory for binary stream character-at-a-time processing.

Note: The memory parameter identifies this file as a memory file that is accessible only from C programs. This parameter is the default and is ignored.If you specify a mode or keyword parameter that is not valid on fopen(), errno is set to EBADMODE.

Example

The following example illustrates how to open a binary stream file.

ILE C Source to Open a Binary Stream File

Writing, reading, and updating can be performed on binary stream files opened for character-at-a-time processing.

ILE C Source to Open a Binary Stream File

To open an iSeries Data Management system file as a binary stream file for character-at-a-time processing, use theOPEN() member function with ios::binary as well as any of the following modes:

  • ios::app
  • ios::ate
  • ios::in
  • ios::out
  • ios::trunk

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-ILE Topics