====== rewind ======
===== Description =====
Rewind a file handle to the start of the file stream.
===== Function prototype =====
void rewind
===== Arguments =====
^ Name ^ Type ^ Comment ^
| //hFile// | voidptr | A file handle, as created by [[plugins:general:zeoscript:reference:functions:fopen]] or [[plugins:general:zeoscript:reference:functions:fopen_s]]. |
===== Return value =====
None.
===== Example =====
// open a file, fseek forward, then rewind
// open file
voidptr fp
assert "Could not open file!"
// fseek to 10
assert "Fseek failed!"
echo // should be at 10 now
// rewind
rewind fp
echo // should be back at 0
// close
fclose fp
... the output of which is written to the event log by [[plugins:general:zeoscript:reference:functions:echo]] as:
10
0
===== Comments =====
This function is equivalent to calling '[[plugins:general:zeoscript:reference:functions:fseek]] 0 0'.
===== See also =====
* [[plugins:general:zeoscript:reference:functions:fopen]]
* [[plugins:general:zeoscript:reference:functions:fopen_s]]
* [[plugins:general:zeoscript:reference:functions:fclose]]
* [[plugins:general:zeoscript:reference:functions:fread]]
* [[plugins:general:zeoscript:reference:functions:fwrite]]
* [[plugins:general:zeoscript:reference:functions:fgetc]]
* [[plugins:general:zeoscript:reference:functions:fputc]]
* [[plugins:general:zeoscript:reference:functions:fseek]]
* [[plugins:general:zeoscript:reference:functions:ftell]]