Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (2) — Plan9 1st Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(2)

open(2)

SEEK(2)

NAME

seek − change file offset

SYNOPSIS

long seek(int fd, long n, int type)

DESCRIPTION

­Seek sets the offset for the file associated with ­fd as follows:

If ­type is 0, the offset is set to ­n bytes. 

If ­type is 1, the pointer is set to its current location plus n.

If ­type is 2, the pointer is set to the size of the file plus n.

The new file offset value is returned. 

Seeking far beyond the end of a file, then writing, creates a gap, or ‘hole,’ that occupies no physical space and reads as zeros. 

Seeking in a directory is not allowed. 

SEE ALSO

intro(2), open(2)

DIAGNOSTICS

Sets ­errstr. 

Plan 9  —  January 03, 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026