Overview | ||||||||||||||||
Group | ||||||||||||||||
Quick Info
|
OpenFile
The OpenFile function creates, opens, reopens, or deletes a file. This function is provided for compatibility with 16-bit versions of Windows. In particular, the OpenFile function cannot open a named pipe. Win32-based applications should use the CreateFile function. HFILE OpenFile( LPCSTR lpFileName,
| // pointer to filename
|
LPOFSTRUCT lpReOpenBuff,
| // pointer to buffer for file information
|
UINT uStyle
| // action and attributes
|
);
|
|
Value
| Meaning
|
OF_CANCEL
| Ignored. In the Win32 application programming interface (API), the OF_PROMPT
style produces a dialog box containing a Cancel button.
|
OF_CREATE
| Creates a new file. If the file already exists, it is truncated to zero length.
|
OF_DELETE
| Deletes the file.
|
OF_EXIST
| Opens the file and then closes it. Used to test for a file's existence.
|
OF_PARSE
| Fills the OFSTRUCT structure but carries out no other action.
|
OF_PROMPT
| Displays a dialog box if the requested file does not exist. The dialog box
informs the user that Windows cannot find the file, and it contains Retry and
Cancel buttons. Choosing the Cancel button directs OpenFile to return a file-not-found error message.
|
OF_READ
| Opens the file for reading only.
|
OF_READWRITE
| Opens the file for reading and writing.
|
OF_REOPEN
| Opens the file using information in the reopen buffer.
|
OF_SHARE_COMPAT
| For MS-DOSbased file systems using the Win32 API, opens the file with compatibility
mode, allowing any process on a specified computer to open the file any number of
times. Other efforts to open with any other sharing mode fail.
Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ | FILE_SHARE_WRITE flags. |
OF_SHARE_DENY_NONE
| Opens the file without denying read or write access to other processes. On
MS-DOS-based file systems using the Win32 API, if the file has been opened in
compatibility mode by any other process, the function fails.
Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ | FILE_SHARE_WRITE flags. |
OF_SHARE_DENY_READ
| Opens the file and denies read access to other processes. On MS-DOS-based file
systems using the Win32 API, if the file has been opened in compatibility mode
or for read access by any other process, the function fails. Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_WRITE flag.
|
OF_SHARE_DENY_WRITE
| Opens the file and denies write access to other processes. On MS-DOS-based
file systems using the Win32 API, if the file has been opened in compatibility
mode or for write access by any other process, the function fails.
Windows NT: This flag is mapped to the CreateFile function's FILE_SHARE_READ flag. |
OF_SHARE_EXCLUSIVE
| Opens the file with exclusive mode, denying both read and write access to
other processes. If the file has been opened in any other mode for read or write
access, even by the current process, the function fails.
|
OF_VERIFY
| Verifies that the date and time of the file are the same as when it was
previously opened. This is useful as an extra check for read-only files.
|
OF_WRITE
| Opens the file for writing only.
|
- The directory from which the application loaded.
- The current directory.
- Windows 95: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
- Windows NT: The 16-bit Windows system directory. There is no Win32 function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM.
- The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
- The directories that are listed in the PATH environment variable.
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers - More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples - Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database