AoOpenFilespec()

Find the first control that can open a stream to the given file in the given mode

Synopsis:

#include <aoi.h>

AOIStream_t *AoOpenFilespec(const char *fspec,
                            const char *mode);

Arguments:

fspec
The name of the file you want to access through a stream.
mode
The mode for opening the file stream, one of:
  • rb — Read binary
  • wb — Write binary

Library:

libaoi.so

Description:

This function iterates through all available AOI controls that export an AOStreamer interface and returns a stream object from the first control that can open the specified file in the specified mode. The control field in the returned object references the control, which is held. When you call AoStreamClose() to close the stream, the library releases the control referenced by this field.

Note: We recommend that instead of using AoOpenFilespec(), you use AoOpenStream(). This other function lets you specify extra parameters and returns meaningful error information.

Returns:

A pointer to an AOIStream_t structure representing the successfully opened stream, or NULL if the stream couldn't be opened in the requested mode by any control.

Classification:

QNX Neutrino