The mi_stream_open_fio() function
The mi_stream_open_fio() function opens a new stream on an operating-system file.
Syntax
MI_STREAM *mi_stream_open_fio(strm_desc, filename, open_flags, open_mode)
MI_STREAM *strm_desc;
char *filename;
mi_integer open_flags;
mi_integer open_mode;
- strm_desc
- A pointer to a stream descriptor.
- filename
- The path name of an operating-system file.
- open_flags
- An integer bit mask that can be any of the following open flags:
Open flags that the operating-system open command supports: UNIX™ or Linux™ open(2) or Windows™ _open.
- MI_O_SERVER_FILE (default)
- The file to open is on the server computer.
- MI_O_CLIENT_FILE
- The file to open is on the client computer.
- open_mode
- The file-permission mode in a format that the operating-system open command supports: UNIX™ or Linux™ open(2) or Windows™ _open.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_stream_open_fio() function initializes and opens a data stream on the operating-system file that filename specifies.
The mi_stream_open_fio() function returns a stream descriptor that identifies the file stream. This function is a constructor function for a stream descriptor and allocates the new stream descriptor in the current memory duration.
Return values
- An MI_STREAM pointer
- A pointer to the newly opened stream on the specified file.
- NULL
- The function was not successful.