[This function is provided for compatibility with 16-bit versions of Windows. New applications should use the CreateFile function.]
Creates or opens the specified file. This documentation is included only for troubleshooting existing code.
HFILE _lcreat( LPCSTR lpPathName, int iAttribute );
The name of the file. The string must consist of characters from the Windows ANSI character set.
The attributes of the file.
This parameter must be set to one of the following values.
||Normal. Can be read from or written to without restriction.|
||Read-only. Cannot be opened for write.|
||Hidden. Not found by directory search.|
||System. Not found by directory search.|
If the function succeeds, the return value is a file handle. Otherwise, the return value is HFILE_ERROR. To get extended error information, use the GetLastError function.
If the file does not exist, _lcreat creates and opens a new file for writing. If the file does exist, _lcreat truncates the file size to zero and opens it for reading and writing.
When the function opens a file, the pointer is set to the beginning of the file.
Use the _lcreat function with care. It can open any file, even one already opened by another function.
|Header||winbase.h (include Windows.h)|