Function FOpen() Foundation
Opens a file at the operating system level.
FOpen( <cFilename>, [<nMode>]) --> nHandle
Constant | File operation |
---|---|
FO_READ *) | read only |
FO_WRITE | write only |
FO_READWRITE | read and write |
|
Constant | Access right |
---|---|
FO_COMPAT | only one user (like single station) |
FO_EXCLUSIVE | exclusive use (like single station) |
FO_DENYWRITE | other users have no write access |
FO_DENYREAD | other users have no read access |
FO_DENYNONE | other users have read and write access |
FO_SHARED *) | like FO_DENYNONE |
|
Constants | Description |
---|---|
FA_INHERITABLE | File handle can be used in child processes (RunShell()) |
FOpen() returns an integer numeric value. This number is the file handle provided by the operating system for <cFilename>. If an error occurs, the return value is -1 and the error code can be retrieved with FError().
The low level file function FOpen() opens a file at the operating system level. When the file named <cFilename> does not exist or cannot be opened in the access mode specified by <nMode>, FOpen() returns the value -1. The file error can then be determined from the error code returned by the function FError().
When the file is opened successfully, the return value of FOpen() (the file handle) must be assigned to a variable so that further file operations can be performed on the file.
Low level file functions do not use either the path set with SET PATH or specified with SET DEFAULT. Therefore, <cFilename> must be a complete file name with drive and path specified. If no drive or path is included in <cFilename>, the file is assumed to reside in the current directory.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.