Go to: Return value. Related commands. Examples.

Synopsis

frewind <int>

Rewind the file to the first byte.

Return value

int

Related commands

popen, pclose, feof, fgetline, fgetword, fopen, fclose, fflush, fprint, fread, fwrite

Examples


	// Make a sample file to use as a test example
	//
	$exampleFileName = ( `internalVar -userTmpDir` + "example.tmp" );
	$fileId=`fopen $exampleFileName "w"`;
	fprint $fileId "Hello there\n";
	fclose $fileId;

	// Read the first word out of the file, then rewind and read it again
	//
	$fileId=`fopen $exampleFileName "r"`;
	print ( `fgetword $fileId` + "\n" );
	frewind $fileId;
	print ( `fgetword $fileId` + "\n" );	
	fclose $fileId;