mmioOpen(3mms) — Subroutines
Name
mmioOpen --- Open a file for unbuffered or buffered I/O
Syntax
#include <mme/mme_api.h>
HMMIO APIENTRY mmioOpen(LPSTR szFileName,
LPMMIOINFO lpmmioinfo,
DWORD dwOpenFlags);
Arguments
LPSTR szFileName
Specifies a pointer to a string containing the file name of the file to open.
The file name should not be longer than 128 bytes, including the terminating NULL. The length of the path string cannot exceed PATH_MAX nor can a component exceed NAME_MAX.
LPMMIOINFO lpmmioinfo
This parameter is not used; set it to NULL.
DWORD dwOpenFlags
Specifies options for opening the file. The following flags are defined:
MMIO_READ
Opens the file for reading only. This is the default flag if MMIO_WRITE and MMIO_READWRITE are not specified.
MMIO_WRITE
Opens the file for writing only. Do not read from a file opened in this mode.
MMIO_READWRITE
Opens the file for both reading and writing.
MMIO_CREATE
Creates a new file. If the file already exists, it is truncated to zero length. For memory files, MMIO_CREATE indicates that the end of the file is initially at the start of the buffer.
MMIO_DELETE
Deletes a file. If this flag is specified, the szFileName argument should not be NULL. The return value will be TRUE (cast to HMMIO) if the file was deleted successfully, and FALSE otherwise. Do not call the mmioClose function for a file that has been deleted. If this flag is specified, all other flags are ignored.
Description
The mmioOpen function opens a file for unbuffered or buffered I/O.
Extensions
None.
Return Values
Returns a file handle to the opened file. This handle is not a UNIX file handle; do not use it with any file I/O functions other than multimedia file I/O (mmio) functions. If the file cannot be opened, the return value is NULL. If the lpmmioinfo argument is not NULL, then the wError field of the MMIOINFO data structure contains error information returned by the I/O procedure.
See Also
mmioClose(3mms), mmioRead(3mms), mmioSeek(3mms), mmioWrite(3mms)