fsetpos

Positions a stream according to the value of an object

Local Servers:nonblocking
Remote Servers:nonblocking
Classification:ANSI
Platform:NLM
Service:Stream I/O

Syntax

  #include <stdio.h>  
   
  int fsetpos  (  
     FILE           *fp,  
     const fpos_t   *pos);
  

Parameters

fp
(IN) Points to the file.
pos
(IN) Points to the object that specifies the new file position.

Return Values

The fsetpos function returns a value of 0 if successful; otherwise, the fsetpos function returns a nonzero value. If an error occurs, errno is set.

Remarks

The fsetpos function positions the file pointed to by fp according to the value of the object pointed to by pos, which shall be a value returned by an earlier call to the fgetpos function on the same file.

See Also

fgetpos, fopen, fseek, ftell

fsetpos Example

  #include <stdio.h>  
   
  main ()  
  {  
     FILE     *fp;  
     fpos_t   position;  
     fgetpos (fp, &position);  
     fsetpos (fp, &position);  
  }