fgetpos64

Stores the current file position of a stream in an object.

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

Syntax

  #include <stdio.h> 
   
  int fgetpos64 (
     FILE       *fp, 
     fpos64_t   *pos);
  

Parameters

fp

(IN) Points to the file.

pos

(OUT) Points to the object into which the position of the file is stored.

Return Values

If successful, returns 0. Otherwise, returns a nonzero value and sets errno to one of the following:

Decimal

Constant

Description

4

EBADF

The file descriptor is not valid.

81

EOVERFLOW

The current value of the file position cannot be represented correctly in an object of type fpos_t.

33

ESPIPE

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

Remarks

The fgetpos64 function stores the current position of the file pointed to by fp in the object pointed to by pos. The value stored in pos is usable by the fsetpos64 function for repositioning the file to the position it had at the time of the call to fgetpos64.

The fgetpos64 function is equivalent to fgetpos except that it handles files larger than 2 GB.

See Also