Skip to content

Latest commit

 

History

History
141 lines (114 loc) · 2.97 KB

nf-winbase-_lcreat.md

File metadata and controls

141 lines (114 loc) · 2.97 KB
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.
_lcreat
_lcreat function [Windows API]
winbase/_lcreat
winprog._lcreat
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
_lcreat
winbase/_lcreat
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Kernel32-Private-l1-1-0.dll
kernel32legacy.dll
API-MS-Win-Core-Kernel32-Private-l1-1-1.dll
API-MS-Win-Core-Kernel32-Private-l1-1-2.dll
_lcreat

_lcreat function

-description

[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.

-parameters

-param lpPathName

The name of the file. The string must consist of characters from the Windows ANSI character set.

-param iAttribute

The attributes of the file.

This parameter must be set to one of the following values.

Value Meaning
0
Normal. Can be read from or written to without restriction.
1
Read-only. Cannot be opened for write.
2
Hidden. Not found by directory search.
4
System. Not found by directory search.

-returns

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.

-remarks

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.

-see-also

CreateFile