tf_get_position(), sf_get_position()

Purpose

Returns the current file pointer position

Old names

#define _vfposn tf_get_position

#define _afposn sf_get_position

Syntax (CCOWN)

file_pointer tf_get_position(int file_handle)
file_pointer sf_get_position(int file_handle)

Syntax (DP4DBAPI)

dp4_file_pointer dp4_sf_get_position(FCONN * fconn);
dp5_file_pointer dp4_sf64_get_position(FCONN * fconn);

Parameters

int file_handle

File handle of file opened with tf_open() or sf_open().

 

FCONN * fconn

File handle of file opened with dp4_sf_open().

Description

The tf_get_position() and sf_get_position() functions give the current file pointer position of the file with the given file handle.

sf_get_position() function calls the file handling support in the database manager, and the tf_get_position() 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().

Return values

Returns the file position if successful, otherwise a negative number. If sf_get_poistion() or tf_get_position() fail they call sys_fail() function and do not normally return. The DP4DBAPI versions of the API return DP4_INVALID_PTR, or DP5_INVALID_PTR for the 64 bit version.

See also

tf_open()