Next: fileread, Previous: fftshift, Up: Internal Routines [Contents][Index]
fileptr(lun [, offset] [, /start, /eof, /advance])
fileptr, lun [, offset] [, /start, /eof, /advance]
Show or set a file pointer. fileptr,lun
shows and
fileptr(lun)
returns the position of the file pointer of
logical unit lun
in bytes from the start of the file. If
offset
and/or a keyword are specified, then the file
pointer is modified. If a keyword is specified but not
offset
, then zero is taken for offset
. You
can move a file pointer beyond the end of a file, but not before the
beginning of the file. If you read data from beyond the end of a file,
or from a dataless gap in a file, then zeros are returned.
/start
counts from the start of the file.
/eof
counts from the end-of-file marker (which is one byte beyond the last byte in the file).
/advance
counts from the current position.
If no keyword is defined, then non-negative offset
counts
from the start and negative offset
from the end-of-file
marker (with -1
pointing at the last byte of the file). The
function version returns 1
on success, 0
or failure.