[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


lseek

Seek a position on a file stream.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <unistd.h>
long lseek(int fildes, long offset, int origin);
Parameters:

Parameters for this facility are:

fildes  
int  
The file descriptor  
offset  
long  
The offset to move in bytes  
origin  
int  
The starting point of the seek  

Remarks:

The function lseek() sets the file position location a specified byte offset from a specified initial location.

The origin of the offset must be one of the positions in "The lseek offset positions.."

The lseek offset positions.:

Macro
Meaning
SEEK_SET  
Beginning of file  
SEEK_CUR  
Current Position  
SEEK_END  
End of File  

Return:

If successful, lseek() returns the number of bytes offset. If unsuccessful, it returns a value of negative one long integer.

See Also:

"fseek"

"ftell"

"open"

For example of lseek() usage:
Refer to "Example of close() usage.".


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000