TIOStream.Seek function
Set the stream position.
Declaration
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64
; overrideArguments
Offset | Byte offset to position the stream on. |
Origin | Where to start the byte offset. |
Function result
New position of the stream.
Description
Seek overrides the standard
Seek implementation.
Normally, standard input, output and stderr are not seekable.
The
TIOStream stream tries to provide seek capabilities for the
following limited number of cases:
- Origin=soFromBeginning
- If
Offsetis larger than the current position, then the remaining bytes are skipped by reading them from the stream and discarding them, if the stream is of typeiosInput. - Origin=soFromCurrent
- If
Offsetis zero, the current position is returned. If it is positive, thenOffsetbytes are skipped by reading them from the stream and discarding them, if the stream is of typeiosInput.
All other cases will result in a EIOStreamError exception.
Errors
An EIOStreamError exception is raised if the stream does not allow the requested seek operation.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
