www.delorie.com/djgpp/doc/libc-2.01/libc_453.html   search  
Go to the first, previous, next, last section, table of contents.


lseek

Syntax

#include <unistd.h>

off_t lseek(int fd, off_t offset, int whence);

Description

This function moves the file pointer for fd according to mode:

SEEK_SET
The file pointer is moved to the offset specified.
SEEK_CUR
The file pointer is moved relative to its current position.
SEEK_END
The file pointer is moved to a position offset bytes from the end of the file. The offset is usually nonpositive in this case.

Return Value

The new offset is returned.

Example

lseek(fd, 12, SEEK_CUR); /* skip 12 bytes */


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997