SetFilePointerEx function

Syntax

BOOL SetFilePointerEx(
  [in]            HANDLE  hFile,
  [in]            LARGE_INTEGER liDistanceToMove,
  [out, optional] PLARGE_INTEGER lpNewFilePointer,
  [in]            DWORD   dwMoveMethod
);

Sets the file pointer of the specified file to a specified location.

Parameters

Parameter Description
hFile A handle to the file.
liDistanceToMove A LARGE_INTEGER structure that specifies the number of bytes to move the file pointer. This parameter can be positive or negative.
lpNewFilePointer A pointer to a LARGE_INTEGER structure that receives the new file pointer. This parameter can be NULL.
dwMoveMethod The starting point for the file pointer. This parameter can be one of the following values:
  • FILE_BEGIN (0): The starting point is the beginning of the file.
  • FILE_CURRENT (1): The starting point is the current file pointer.
  • FILE_END (2): The starting point is the end of the file.

Return value

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

Package Minimum supported client Minimum supported server
Header fileapi.h (include windows.h) fileapi.h (include windows.h)

See also