sets or determines the current file position
INCLUDE 'iolib.h' filepos(Handle,X), X1 is X + 20, filepos(Handle,X1)
filepos(Handle,Pos) (i,i) (i,o)
handle(Handle)(i) handle of the file to be examined
integer(Pos) (i) position within the file where to move to
integer(Pos) (o) current position within the file
The position within the file associated with Filehandle is either set or returned. Fails if a positions could not be set, e.g. if handle is bound to a window instead of a file on disk.
openread(file,"test"), readdevice(file), filepos(file,20), % skip 20 first characters readln(X), readdevice(stdin), closefile(file).
A runtime error if handle is not valid. Fails if Pos exceeds actual file size.
prolog-process, client-server, object
filesize , deletefile , openwrite , openread