UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:winbase._lcreat |
_lcreat function (winbase.h) |
Creates or opens the specified file. |
|
winprog\_lcreat.htm |
winprog |
89e19823-c720-4bfc-95d5-18942573dd94 |
12/05/2018 |
_lcreat, _lcreat function [Windows API], winbase/_lcreat, winprog._lcreat |
winbase.h |
Windows.h |
Windows |
Kernel32.lib |
Kernel32.dll |
Windows |
19H1 |
|
|
|
|
|
|
[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.
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.
Value | Meaning |
---|---|
|
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.