_llseek function

[This function is provided for compatibility with 16-bit versions of Windows. New applications should use the SetFilePointer function.]

Repositions the file pointer for the specified file.

Syntax

LONG _llseek(
  HFILE hFile,
  LONG  lOffset,
  int   iOrigin
);

Parameters

hFile

A handle to an open file. This handle is created by _lcreat.

lOffset

The number of bytes that the file pointer is to be moved.

iOrigin

The starting point and the direction that the pointer will be moved.

This parameter must be set to one of the following values.

Value Meaning
0
Moves the pointer from the beginning of the file.
1
Moves the file from its current location.
2
Moves the pointer from the end of the file.

Return Value

If the function succeeds, the return value specifies the new offset. Otherwise, the return value is HFILE_ERROR. To get extended error information, use the GetLastError function.

Remarks

When a file is initially opened, the file pointer is set to the beginning of the file. The _llseek function moves the pointer without reading data, which allows random access to the content of the file.

Requirements

   
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

SetFilePointer