Platform SDK: Files and I/O |
The _llseek function repositions the file pointer in a previously opened file.
Note This function is provided only for compatibility with 16-bit versions of Windows. Win32-based applications should use the SetFilePointer function.
LONG _llseek( HFILE hFile, // handle to file LONG lOffset, // number of bytes to move int iOrigin // starting position );
Value | Meaning |
---|---|
FILE_BEGIN | Moves the file pointer lOffset bytes from the beginning of the file. |
FILE_CURRENT | Moves the file pointer lOffset bytes from its current position. |
FILE_END | Moves the file pointer lOffset bytes from the end of the file. |
If the function succeeds, the return value specifies the new offset of the pointer, in bytes, from the beginning of the file.
If the function fails, the return value is HFILE_ERROR. To get extended error information, call GetLastError.
When a file is initially opened, the file pointer is set to the beginning of the file. The _llseek function moves the pointer an arbitrary amount without reading data, which facilitates random access to the file's contents.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
File I/O Overview, File I/O Functions, _lopen, SetFilePointer