ftell64

Returns the current value of the file position indicator for a stream.

Library:LibC
Classification:Other
Service:File and Directory I/O

Syntax

  #include <stdio.h> 
   
  off64_t ftell64 (
     FILE   *fp);
  

Parameters

fp

(IN) Points to the file.

Return Values

If successful, returns the current read/write position of the file specified by fp. Otherwise, returns -1 and sets errno to one of the following:

Decimal

Constant

Description

4

EBADF

The file descriptor is not valid.

33

ESPIPE

The file descriptor underlying stream is associated with a pipe, a socket, or a FIFO.

81

EOVERFLOW

The current file offset cannot be represented correctly in an object of type long.

Remarks

The ftell64 function returns the current read/write position of the file specified by fp. This position defines the character to be read or written by the next I/O operation on the file. You can use the value returned by ftell64 in a subsequent call to fseek64 in order to set the file to the same position.

The ftell64 function is equivalent to ftell except that it handles files larger than 2 GB.

See Also