tf_close(), sf_close()

Purpose

Closes a file

Old names

#define _vclose tf_close

#define _aclose sf_close

Syntax (CCOWN)

tf_close(int file_handle)
sf_close(int file_handle)

Syntax (DP4DBAPI)

BOOLEAN dp4_sf_close(FCONN * fconn);

Parameters

int file_handle

File handle to close, obtained from an earlier call to tf_open() or sf_open()

 

FCONN * fconn

File handle to close,, obtained from an earlier call to dp4_sf_open()

Description

The functions tf_close() and sf_close() close a file handle previously returned from a call to the corresponding tf_open() or sf_open() function. All the internal buffers are flushed as necessary.

The sf_close() function calls the file handling support in the database manager, and the tf_close() function calls the file handling support in the terminal manager. You must not call an sf_ function with a handle obtained with tf_open(), or a tf_ function with a handle obtained with sf_open().

Failing to close a file after writing data to it is a common error and often leads to loss of data.

If the file was opened with the value VF_TMP contained in the parameter flags, the file is deleted.

For the DP4DBAPI version of the API the return value is TRUE if the function completes without any errors. Whether or not there is an error the file handle is invalid on return from this call.

See also

tf_open()