_dos_open
 
Syntax
 
#include <fcntl.h>
#include <share.h>
#include <dos.h>
 
unsigned int _dos_open(const char *filename, unsigned short mode,int *handle);
 
Description
 
This is a direct connection to the MS-DOS open function call (%ah = 0x3D). This function opens the given file with the given mode and puts handle of file into handle if openning is successful. Meaning of mode parameter is the following:
 
 
This function does not support long filenames, even on systems where the LFN API (see section LFN) is available. For LFN-aware functions with similar functionality see _open, _creat, and _creatnew. Also see open, and creat, which are Posix-standard.
 
Return Value
 
Returns 0 if successful or DOS error code on error (and sets errno to EACCES, EINVAL, EMFILE or ENOENT).
 
Example
 
int handle;
if ( !_dos_open("FOO.DAT", O_RDWR, &handle) )
   puts("Wow, file opening was successful !");