Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:docs:fapi:dosopen [2021/09/18 11:39] – prokushev | en:docs:fapi:dosopen [2021/09/29 10:38] (current) – prokushev | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| ===== Parameters ===== | ===== Parameters ===== | ||
| - | * FileName (PSZ) - input : Address of the ASCIIZ path name of the file, named pipe, or device to be opened. | + | * FileName ([[PSZ]]) - input : Address of the ASCIIZ path name of the file, named pipe, or device to be opened. | 
| - | * FileHandle (PHFILE) - output : Address of the handle for the file, named pipe, or device. | + | * FileHandle ([[PHFILE]]) - output : Address of the handle for the file, named pipe, or device. | 
| - | * ActionTaken (PUSHORT) - output : Address of the action taken as a result of DosOpen. | + | * ActionTaken ([[PUSHORT]]) - output : Address of the action taken as a result of DosOpen. | 
| ^ Value ^ Definition ^ | ^ Value ^ Definition ^ | ||
| Line 22: | Line 22: | ||
| | 0003H | File replaced | | | 0003H | File replaced | | ||
| - | * FileSize (ULONG) - input : File's new logical size (EOD), in bytes. This parameter is significant only when creating a new file or replacing an existing file. Otherwise, it is ignored. | + | * FileSize ([[ULONG]]) - input : File's new logical size (EOD), in bytes. This parameter is significant only when creating a new file or replacing an existing file. Otherwise, it is ignored. | 
| - | * FileAttribute (USHORT) - input : File attribute bits. | + | * FileAttribute ([[USHORT]]) - input : File attribute bits. | 
| Defined below: | Defined below: | ||
| Line 42: | Line 42: | ||
| ^ Bit ^ Description ^ | ^ Bit ^ Description ^ | ||
| | 15-8 | Reserved and must be zero | | | 15-8 | Reserved and must be zero | | ||
| - | | 7-4 | 0000 = Fail if file does not exist 0001 = Create file if file does not exist | | + | | 7-4 | 0000 = Fail if file does not exist | | 
| - | | 3-0 | 0000 = Fail if the file already exists. 0001 = Open the file if it already exists. 0010 = Replace the file if it already exists | | + | | ::: | 0001 = Create file if file does not exist | | 
| + | | 3-0 | 0000 = Fail if the file already exists  | ||
| + | | ::: | 0001 = Open the file if it already exists  | ||
| + | | ::: | 0010 = Replace the file if it already exists | | ||
| - | * OpenMode (USHORT) - input : The OpenMode parameter contains the following bit flags: | + | * OpenMode ([[USHORT]]) - input : The OpenMode parameter contains the following bit flags: | 
| ^ Bit ^ Description ^ | ^ Bit ^ Description ^ | ||
| | 15 | DASD Open flag: | | | 15 | DASD Open flag: | | ||
| - | | ::: |          | + | | ::: | 0 = FileName represents a file to be opened in the normal way. | | 
| - | | ::: |          | + | | ::: | 1 = FileName is " | 
| - | | ::: | to be opened for direct access. | | + | |
| | 14 | Write-Through flag: | | | 14 | Write-Through flag: | | ||
| - | | ::: |        | + | | ::: | 0 = Writes to the file may be run through the file system buffer cache. | | 
| - | | ::: |        | + | | ::: | 1 = Writes to the file may go through the file system buffer cache but the sectors are written (actual file I/O completed) before a synchronous | | 
| - | | ::: | the sectors are written (actual file I/O completed) before a synchronous | | + | | ::: | write call returns. This state of the file defines it as a synchronous file. | | 
| - | | ::: |            | + | | ::: | For synchronous files, this is a mandatory bit in that the data must be written out to the medium for synchronous write operations. | | 
| - | | ::: |            | + | | ::: | This bit is not inherited by child processes. | | 
| - | | ::: | written out to the medium for synchronous write operations. | | + | |
| - | | ::: |        | + | |
| | 13 | Fail-Errors flag. Media I/O errors are handled as follows: | | | 13 | Fail-Errors flag. Media I/O errors are handled as follows: | | ||
| - | | ::: | 0 = Reported through the system critical error handler. | | + | | ::: | 0 = Reported through the system critical error handler. | | 
| - | | ::: | 1 = Reported directly to the caller by way of return code. | | + | | ::: | 1 = Reported directly to the caller by way of return code. | | 
| - | | ::: |      | + | | ::: | Media I/O errors generated through an IOCTL Category 8 function always get | | 
| - | | ::: |      | + | | ::: | reported directly to the caller by way of return code. The Fail-Errors function | | 
| - | | ::: |      | + | | ::: | applies only to non-IOCTL handle-based file I/O calls. | | 
| - | | ::: |      | + | | ::: | This bit is not inherited by child processes. | | 
| - | | 12 |        | + | | 12 | No-Cache/ | 
| - | | ::: | 0 = It is advisable for the disk driver to cache the data in I/O operations on this file. | | + | | ::: | 0 = It is advisable for the disk driver to cache the data in I/O operations on this file. | | 
| - | | ::: | 1 = I/O to the file need not be done through the disk driver cache. | | + | | ::: | 1 = I/O to the file need not be done through the disk driver cache. | | 
| - | | ::: |      | + | | ::: | This bit advises FSDs and device drivers whether it is worth caching the data. | | 
| - | | ::: |      | + | | ::: | Like the write-through bit, this is a per-handle bit and is not inherited by child processes. | | 
| - | | 11 | Reserved and must be zero. | | + | | 11 | Reserved and must be zero. | | 
| - | | 10-8 | The locality of reference flags contain information about how the application is to access the file. | | + | | 10-8 |The locality of reference flags contain information about how the application is to access the file. | | 
| - | | ::: |      | + | | ::: | Value    | 
| - | | ::: | 000 No locality known. | | + | | ::: | 000 No locality known. | | 
| - | | ::: | 001 Mainly sequential access. | | + | | ::: | 001 Mainly sequential access. | | 
| - | | ::: | 010 Mainly random access. | | + | | ::: | 010 Mainly random access. | | 
| - | | ::: | 011 Random with some locality.| | + | | ::: | 011 Random with some locality.| | 
| - | | 7 | Inheritance flag: | | + | | 7 | Inheritance flag: | | 
| - | | ::: | 0 = File handle is inherited by a spawned process resulting from a DosExecPgm call. | | + | | ::: | 0 = File handle is inherited by a spawned process resulting from a DosExecPgm call. | | 
| - | | ::: | 1 = File handle is private to the current process. | | + | | ::: | 1 = File handle is private to the current process. | | 
| - | | ::: | This bit is not inherited by child processes. | | + | | ::: | This bit is not inherited by child processes. | | 
| - | | 6-4 | Sharing Mode flags. | | + | | 6-4 | Sharing Mode flags. | | 
| - | | ::: |    This field defines any restrictions to file access placed by the caller on other processes:  | + | | ::: | This field defines any restrictions to file access placed by the caller on other processes:  | 
| - | | ::: |      | + | | ::: | Value        | 
| - | | ::: | 001 Deny Read/Write access | | + | | ::: | 001 Deny Read/Write access | | 
| - | | ::: | 010 Deny Write access | | + | | ::: | 010 Deny Write access | | 
| - | | ::: | 011 Deny Read access | | + | | ::: | 011 Deny Read access | | 
| - | | ::: | 100 Deny neither Read or Write access (Deny None). Any other value is invalid. | | + | | ::: | 100 Deny neither Read or Write access (Deny None). Any other value is invalid. | | 
| - | | 3 | Reserved and must be zero. | | + | | 3 | Reserved and must be zero. | | 
| - | | 2-0 |        | + | | 2-0 | Access Mode flags. This field defines file access required by the caller: | | 
| - | | ::: |          | + | | ::: | Value            | 
| - | | ::: |            000              | + | | ::: | 000              | 
| - | | ::: |            001              | + | | ::: | 001              | 
| - | | ::: |            010              | + | | ::: | 010              | 
| Any other value is invalid.  | Any other value is invalid.  | ||
| Line 109: | Line 109: | ||
| ==== Access Mode ==== | ==== Access Mode ==== | ||
| - | |||
|                          |                          | ||
| Specify the type of access to the file needed by your process (access mode). | Specify the type of access to the file needed by your process (access mode). | ||




