The lld_seek() function

This function sets the position for the next read or write operation to or from a large object that is open for reading or writing.

Syntax

API
mi_integer lld_seek(conn, io, offset, whence, new_offset, error)
   MI_CONNECTION*               conn
   LLD_IO*                      io;
   mi_int8*                     offset;
   mi_integer                   whence;
   mi_int8*                     new_offset;
   mi_integer*                  error; 
ESQL/C
int lld_seek(io,offset, whence, new_offset, error)
   LLD_IO* io;
EXEC SQL BEGIN DECLARE SECTION;
   PARAMETER int8* offset;
EXEC SQL END DECLARE SECTION;
EXEC SQL BEGIN DECLARE SECTION;
   PARAMETER int8* new_offset;
EXEC SQL END DECLARE SECTION;
   int whence;
   int* error;
conn
The connection descriptor established by a previous call to the mi_open() or mi_server_connect() functions. This parameter is for the API interface only. In the ESQL/C and SQL versions of this function, you must already be connected to a server.
io
A pointer to an LLD_IO structure created with a previous call to the lld_open() function.
offset
A pointer to the offset. It describes where to seek in the object. Its value depends on the value of the whence parameter.
  • If whence is LLD_SEEK_SET, the offset is measured relative to the beginning of the object.
  • If whence is LLD_SEEK_CUR, the offset is relative to the current position in the object.
  • If whence is LLD_SEEK_END, the offset is relative to the end of the file.
whence
Determines how the offset is interpreted.
new_offset
A pointer to an int8 that you allocate. The function returns the new offset in this int8.
error
An output parameter in which the function returns an error code.

Usage

Before calling this function, you must open the large object with a call to lld_open().

Although this function takes an 8-byte offset, this offset is converted to the appropriate size for the underlying large object storage system. For example, if the large object is stored in a 32-bit file system, the 8-byte offset is converted to a 4-byte offset, and any attempt to seek past 4 GB generates an error.

Return codes

For an API function, returns MI_OK if the function succeeds and MI_ERROR if it fails.

For an ESQL/C function, returns 0 if the function succeeds and -1 if the function fails.

Context

The lld_open() function

The lld_read() function

The lld_tell() function

The lld_write() function