Seek

public enum Seek

Anchor + offset pair passed to File.seek. The three variants match POSIX SEEK_SET, SEEK_CUR, and SEEK_END; the payload is the offset in bytes (signed, so backwards seeks work).

Examples

try file.seek(to: .Start(0)); // beginning try file.seek(to: .Current(-10)); // back 10 bytes try file.seek(to: .End(0)); // end of file

Cases

case Current(Int64)

Seek by n bytes from the current position. Negative values move backwards.

case End(Int64)

Seek by n bytes from EOF. Use 0 to land exactly at EOF; negative values move backwards from the end.

case Start(Int64)

Seek to an absolute byte offset from the start of the file.

Defined in lang/std/io/file.ks