_creat, _lwrite, _lclose函数

HFILE _lcreat(
  LPCSTR lpPathName,
  int    iAttribute
);

Return Value

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, _lcreattruncates 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.

UINT _lwrite(
  HFILE hFile,
  LPCCH lpBuffer,
  UINT  uBytes
);

Parameters

hFile

A handle to the file that receives the data. This handle is created by _lcreat.

lpBuffer

The buffer that contains the data to be added.

uBytes

TBD

Return Value

If the function succeeds, the return value is the number of bytes written to the file. Otherwise, the return value is HFILE_ERROR. To get extended error information, use the GetLastError function.

HFILE _lclose(
  HFILE hFile
);

Parameters

hFile

Identifies the file to be closed. This handle is returned by the function that created or last opened the file.

Return Value

Handle to file to close.

猜你喜欢

转载自blog.csdn.net/du_shuang/article/details/81089182