rewind

Sets the file position indicator to the beginning of the file

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

Syntax

  #include <stdio.h>  
   
  void rewind  (  
     FILE   *fp);
  

Parameters

fp
(IN) Points to the file.

Remarks

The rewind function sets the file position indicator for the stream indicated by fp to the beginning of the file. It is equivalent to:

     fseek( fp, 0L, SEEK_SET );
  

except that the error indicator for the stream is cleared.

See Also

clearerr, fopen

rewind Example

  #include <stdio.h>  
   
  FILE    *fp;  
   
  if ( (fp = fopen ("program.asm", "r") ) != NULL)  
  {  
     assemble_pass ( 1 );  
     rewind (fp);  
     assemble_pass ( 2 );  
     fclose (fp);  
  }