stream-seek ( n seek-type stream -- )
Factor handbook » Input and output » Streams » Stream protocol

Prev:stream-tell ( stream -- n )
Next:tell-input ( -- n )


Vocabulary
io

Inputs
nan integer
seek-typea seek singleton
streama stream


Outputs
None

Word description
Moves the pointer associated with a stream's handle to an offset n bytes from the seek type so that further reading or writing happens at the new location. For output streams, the buffer is flushed before seeking. Seeking past the end of an output stream will pad the difference with zeros once the stream is written to again.

Three methods of seeking are supported:
seek-absolute
seek-relative
seek-end


Notes
Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams.

See also
stream-tell, stream-seekable?, stream-length

Definition

GENERIC: stream-seek ( n seek-type stream -- )


Methods