Integer_Type fseek (File_Type fp, Integer_Type ofs, Integer_Type whence
The fseek function may be used to reposition the file position
pointer associated with the open file stream fp. Specifically,
it moves the pointer ofs bytes relative to the position
indicated by whence. If whence is set to one of the symbolic
constants SEEK_SET, SEEK_CUR, or SEEK_END, the
offset is relative to the start of the file, the current position
indicator, or end-of-file, respectively.
The function return zero upon success, or -1 upon failure and sets
errno accordingly.
define rewind (fp)
{
if (0 == fseek (fp, 0, SEEK_SET)) return;
vmessage ("rewind failed, reason: %s", errno_string (errno));
}
The current implementation uses an integer to specify the offset.
One some systems, a long integer may be required making this
function fail for very large files, i.e., files that are longer than
the maximum value of an integer.
- slangrtl
-
clearerr,
fclose,
fdopen,
feof,
ferror,
fflush,
fgets,
fgetslines,
fileno,
fopen,
fputs,
fread,
ftell,
fwrite,
isatty,
lseek,
mkdir,
open,
popen
|