Opens a file. These functions are deprecated because more secure versions are available; see _sopen_s, _wsopen_s.
int _wopen( const wchar_t * filename, int oflag [, int pmode] );
Parameters
-
filename
-
File name.
-
oflag
-
Type of operations allowed.
-
pmode
-
Permission mode.
Each of these functions returns a file descriptor for the opened file. A return value of -1 indicates an error, in which case errno is set to one of the following values.
-
EACCES
-
Tried to open read-only file for writing, file's sharing mode does not allow specified operations, or given path is directory.
-
EEXIST
-
_O_CREAT and _O_EXCL flags specified, but filename already exists.
-
EINVAL
-
Invalid oflag or pmode argument.
-
EMFILE
-
No more file descriptors available (too many open files).
-
ENOENT
-
File or path not found.
For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.
The _open function opens the file specified by filename and prepares the file for reading or writing, as specified by oflag. _wopen is a wide-character version of _open; the filename argument to _wopen is a wide-character string. _wopen and _open behave identically otherwise.