t3x.org / t3x / t3x-manual / 32G.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.2.15 RENAME
TOC | Index | Back Next:
3.2.17 WRITE

3.2.16 SEEK

T.SEEK(fdesc, where, origin) ! Fdesc,Num,Num => Num

Move the file pointer associated with the file descriptor 'fdesc' to a new position. 'Where' specifies the desired position and 'origin' specifies where the motion shall start. The following origins are possible:

Constant Origin Distance
T3X.SEEK_SET Beginning of the file +where
T3X.SEEK_FWD Current position +where
T3X.SEEK_END End of the file -where
T3X.SEEK_BCK Current position -where

T3X.SEEK_SET and T3X.SEEK_FWD move the file pointer forward, T3X.SEEK_END and T3X.SEEK_BCK move it backward. In either case, 'where' is an unsigned value.

'Where' is limited to the range 0...65535 in 16-bit environments.

SEEK returns zero upon success and -1 in case of an error.

The SEEK operation is undefined on sequential access devices and pipes.

See also: OPEN, CLOSE, READ, WRITE

Previous:
3.2.15 RENAME
TOC | Index | Back Next:
3.2.17 WRITE