CLOSE
ANSI
The CLOSE instruction flushes all data to the disk and updates the disk directory entry for the file with the latest file attributes. The instruction uses the following formats:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
file
Required. A previously defined and opened FILE, IFILE, or AFILE variable that is closed.
filelist
Required. A previously defined and opened FILELIST variable that is closed.
mode
Optional. One of the valid CLOSE modes as described below.
Flags Affected: NONE
Note the following:
The CLOSE instruction does not automatically set the End Of File (EOF) mark. To set the End of File mark, use the WEOF instruction.
If CLOSE is the first I/O instruction after a PREPARE of a FILE declaration, the file named in the PREPARE statement is deleted from the disk.
The optional {mode} parameter may be one of the following:
|
Mode |
Action |
|
CHOP |
Compatibility only, file closed normally. (non-ANSI) |
|
DELETE |
File is closed and deleted if opened in EXCLUSIVE mode. |
|
EOFSIZE |
Compatibility only, file closed normally. (non-ANSI) |
|
UNCHANGED |
Compatibility only, file closed normally. |
If a FILELIST is specified (format 2), each file defined in the list is closed.
See Also: OPEN, Disk I/O Instructions
![]() |