Top
NetCOBOL V11.0 COBOL File Access RoutinesUser's Guide
FUJITSU Software

3.1 cobfa_close()

Close a file.

long  cobfa_close  (  
  long  fd            /* file descriptor */ 
);

Description

Closes the file indicated by the file descriptor <fd>.

Execution Conditions

File Organization

Sequential file

Executable

Record sequential file

Executable

Relative file

Executable

Indexed file

Executable

Open Mode

INPUT mode

Executable

OUTPUT mode

Executable

I-O mode

Executable

EXTEND mode

Executable

Access Mode

Sequential

Executable

Random

Executable

Dynamic

Executable

Return Values

0: Successful

Function executed successfully

-1: Failed

Function failed. To get extended error information, call the cobfa_errno or cobfa_stat functions

Generated Status

Return value of cobfa_errno ()

Return value of cobfa_stat ()

Successful

FA_ENOERR

0

Function executed successfully

Failure (*)

FA_ENOTOPEN

42

An invalid file descriptor is specified

* : Typical status values are described above. For other values, see "Chapter 5 Error Number and I-O Status".