Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#aros]

DOSSeek

Set the current position for reading and writing

Declaration

Source position: amigados.pas line 2211

function DOSSeek(

  File_: Pointer;

  Position: LongInt;

  Mode: LongInt

):LongInt;

Arguments

File_

  

Pointer to file handle.

Position

  

Value to seek (can be also negative for OFFSET_CURRENT or OFFSET_END)

Mode

  

Start of Seek (OFFSET_*)

Function result

Returns the position before the seek.

Description

DosSeek() sets the read/write cursor for the file file to the position 'position'. This position is used by both DosRead() and DosWrite() as a place to start reading or writing. The result is the current absolute position in the file, or -1 if an error occurs, in which case IoErr() can be used to find more information. mode can be OFFSET_BEGINNING (Start seek from file start), OFFSET_CURRENT (start seek from current position) or OFFSET_END (start seek from end of file). It is used to specify the relative start position. For example, 20 from current is a position 20 bytes forward from current, -20 is 20 bytes back from current.

So that to find out where you are, seek 0 from current. The end of the file is a Seek() positioned by 0 from end. You cannot Seek() beyond the end of a file.

See also

DosRead

  

Read bytes of data from a file

DosWrite

  

Write bytes of data to a file

SetFileSize

  

Sets the size of a file


Documentation generated on: 2021-07-30