CDLseek (FUN)

FUNCTION CDLseek : DINT

Repositions the file offset of an open file. lseek() sets the file offset of hFile to the argument offset according to the directive whence

InOut:

Scope

Name

Type

Comment

Return

CDLseek

DINT

the resulting offset location as measured in bytes from the beginning of the file or -1 if failed.

Input

hFile

RTS_IEC_HANDLE

File descriptor/handle, that was previously created with Open()

offset

DINT

offset in bytes

whence

DINT

one of the following flags:
  • SEEK_SET: The file offset is set to offset bytes

  • SEEK_CUR: The file offset is set to its current location plus offset bytes

  • SEEK_END:The file offset is set to the size of the file plus offset

pResult

POINTER TO DINT

Pointer to linux errno error code, 0 is ok