filepos - Maple Help

filepos

sets or returns the position within a file

 Calling Sequence filepos(file) filepos(file, pos)

Parameters

 file - file name or file descriptor pos - integer offset into the file

Description

 • filepos with one argument returns the current position within the specified file. This is the position at which the next read or write takes place.
 • filepos with two arguments sets the position within the specified file and returns that new position.
 • A specified position of infinity sets the current position to the end of the file.
 • If a file name is given, and that file is not yet open, it is opened in READ mode with type BINARY.
 • With a TEXT file, to determine a position suitable for passing to filepos, call filepos. Only values returned by filepos(file) are guaranteed to be meaningful when used in filepos(file, value). Counting characters while reading or writing is not reliable, because newline characters are translated from/to local conventions, which may use more than a single character. However, filepos(file,infinity) is always valid.

 > $\mathrm{filepos}\left(\mathrm{testFile},\mathrm{\infty }\right)$
 ${15}$ (1)