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:

 

(1)

[label]

CLOSE

{file}[,{mode}]

(2)

[label]

CLOSE

{filelist}[,{mode}]

 

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:

  1. The CLOSE instruction does not automatically set the End Of File (EOF) mark. To set the End of File mark, use the WEOF instruction.

  2. 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.

  3. The optional {mode} parameter may be one of the following:
     

  4. 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.

     

  5. If a FILELIST is specified (format 2), each file defined in the list is closed.

 

 

See Also: OPEN, Disk I/O Instructions

 



PL/B Language Reference BTRIEVE COUNTKEYS