#include <lua/unistd.lh>
- offset = handle:seek(offset, whence)
- offset = handle:tell()
rawio:seek() moves the offset of the file pointer according to the directive whence as follows:
SEEK_SET or "set" | The offset is set to offset bytes. |
SEEK_CUR or "cur" | The offset is set to the current location plus offset bytes. |
SEEK_END or "end" | The offset is set to the length of the file plus offset bytes. |
rawio:tell() is used to read the current file position. It is synonymous to rawio:seek(0, SEEK_CUR).