The mi_file_seek8() function

The mi_file_seek8() function sets the file seek position for the next read or write operation on an open file of length greater that 2 GB.

Syntax

mi_integer mi_file_seek8(fd, offset8, newpos8, whence)
   mi_integer fd;
   mi_int8  *offset8,
   mi_int8  *newpos8,
   mi_integer whence;
fd
The file descriptor for the operating-system file on which to set the seek position. The file descriptor is obtained by a previous call to the mi_file_open() function.
offset8
A pointer to the eight-byte integer (mi_int8) offset from the specified whence file seek position
newpos8
A pointer to the eight-byte integer (mi_int8) that identifies the new file seek position.
whence
This value determines how to interpret the offset value.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_file_seek8() function uses the whence and offset arguments to determine the new seek position of the file that fd identifies, as follows:
  • The whence argument identifies the position from which to start the seek operation.
    Valid values include the following whence constants for both client and server files.
    Whence constant
    Starting seek position
    SEEK_SET
    Set position equal to offset bytes
    SEEK_CUR
    Set position to current location plus offset
    SEEK_END
    Set position to EOF plus offset
  • The offset argument identifies the offset, in bytes, from the starting seek position (which the whence argument specifies) at which to begin the seek.

    This offset value can be negative for all values of whence. To obtain the current seek position for an open smart large object, use the mi_file_tell8() function.

Server only: In a C UDR, this function can move to a new seek position in a file that resides on either the server or client computer. You specify the location of the file when you open it with mi_file_open() function.

Return values

MI_OK
The function was successful and provides the seek position in the newpos8 variable.
MI_ERROR
The function was not successful.

The mi_file_seek8() function does not throw an MI_Exception event when it encounters a runtime error. Therefore, it does not cause callbacks to start.