Intel 05-1832-002 User Manual

Page of 564
208
Voice API for Windows Operating Systems Library Reference — November 2003
dx_fileopen( ) — open a file
dx_fileopen( )
open a file
!
!
!
Description
The dx_fileopen( ) function opens a file specified by filep, and prepares the file for reading and 
writing, as specified by flags. See the _open function in the Microsoft Visual C++ Run-Time 
Library Reference
 for more information.
Use dx_fileopen( ) instead of _open to ensure the compatibility of applications with the libraries 
across various versions of Visual C++.
!
!
!
Cautions
When using 
 to record WAVE files, you cannot use the O_APPEND mode with 
dx_fileopen( ), because for each record, a WAVE file header will be created. 
!
!
!
Errors
If this function returns -1 to indicate failure, a system error has occurred; use dx_fileerrno( ) to 
obtain the system error value. Refer to the dx_fileerrno( ) function for a list of the possible system 
error values.
!
!
!
Example
/* Play a voice file. Terminate on receiving 4 digits or at end of file*/
#include <fcntl.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
Name:
int dx_fileopen(filep, flags, pmode)
Inputs:
const char *filep
filename
int flags
type of operations allowed
int pmode
permission mode
Returns:
file handle if success
-1 if failure
Includes:
srllib.h
dxxxlib.h
Category:
File Manipulation
Mode:
synchronous
Platform:
DM3, Springware