home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


seek

seek 
filehandle
, 
offset
, 
whence

Positions the file pointer for filehandle , just like the fseek(3) call of standard I/O. The first position in a file is at offset 0 , not offset 1 , and offsets refer to byte positions, not line numbers. The function returns 1 upon success, 0 otherwise. For handiness, the function can calculate offsets from various file positions for you. The value of whence specifies which of three file positions your offset is relative to: 0 , the beginning of the file; 1 , the current position in the file; or 2 , the end of the file. offset may be negative for a whence of 1 or 2 .