 |
CreateFile Add comment W32 Constants Translate this page |
 |
 |
This function creates, opens, or truncates a file, communications resource, disk device, or console. It returns a handle that can be used to access the object. It can also open and return a handle to a directory.
Use the CloseHandle function to close an object handle returned by CreateFile |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
HANDLE CreateFile(
LPCTSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDispostion,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER CreateFile IN kernel32;
STRING lpFileName,;
INTEGER dwDesiredAccess,;
INTEGER dwShareMode,;
INTEGER lpSecurityAttributes,;
INTEGER dwCreationDisposition,;
INTEGER dwFlagsAndAttributes,;
INTEGER hTemplateFile
|
 |
 |
 |
| Parameters: |
 |
| Skipped |
 |
 |
| Return value: |
 |
| An open handle to the specified file indicates success |
 |
 |
| My comment: |
 |
lpSecurityAttributes is ignored for Win9*.
Attribute FILE_FLAG_DELETE_ON_CLOSE -- is handy for creating temporary files. Indicates that the operating system is to delete the file immediately after all of its handles have been closed. So you don"t care to delete this file afterwards. When you do not need it anymore -- just close the handle or exit VFP.
The huge variety of avilable attributes makes this command very strong and sophisticated.
The function also can be used to put a message in a mailslot.
See also: CreateFileTransacted |
 |
 |
| Word Index links for the CreateFile : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-07-12 12:00:00 | | Modified: | 2010-05-24 12:25:33 | Visited in last 7 days: 102 |