(C) 1998 AROS - The Amiga Research OS


NAME
#include <proto/dos.h>

LONG Seek (file , position , mode)

LOCATION
In DOSBase at offset 11

SYNOPSIS
BPTR file
LONG position
LONG mode

FUNCTION
Changes the current read/write position in a file and/or reads the current position, e.g to get the current position do a Seek(file,0,OFFSET_CURRENT).

This function may fail (obviously) on certain devices such as pipes or console handlers.

INPUTS
file
filehandle
position
relative offset in bytes (positive, negative or 0).
mode
Where to count from. Either OFFSET_BEGINNING, OFFSET_CURRENT or OFFSET_END.

RESULT
Absolute position in bytes before the Seek(), -1 if an error happened. IoErr() will give additional information in that case.

EXAMPLE

SEE ALSO

NOTES

BUGS

INTERNALS

HISTORY
01.03.1999 turrican
Flush() the file first before doing the seek. This makes sure the buffered IO functions work okay after Seek()
20.10.1998 hkiel
Amiga Research OS
19.05.1998 srittau
IFS_SEEK API
06.12.1997 srittau
Do not use IOFileSys->io_Args

Small changes and bugfixes

27.01.1997 ldp
Polish
09.12.1996 aros
Added empty templates for all missing functions

Moved #include's into first column

24.10.1996 aros
Use the official AROS macros over the __AROS versions.
13.08.1996 digulla
Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h" Replaced __AROS_LA by __AROS_LHA
01.08.1996 digulla
Added standard header for all files
28.07.1996 digulla
Initial revision
28.07.1996 digulla
First CVS version of AROS