TELL(DOS) XENIX System V TELL(DOS)
Name
tell - Gets the current position of the file pointer.
Syntax
#include <io.h>
long tell (handle);
int handle;
Description
The tell function gets the current position of the file
pointer (if any) associated with handle. The position is
expressed as the number of bytes from the beginning of the
file.
Return Value
tell returns the current position. A return value of -1L
indicates an error, and errno is set to EBADF to indicate an
invalid file handle argument. On devices incapable of
seeking (such as terminals and printers), the return value
is undefined.
See Also
fseek(S), lseek(S)
Example
#include <io.h> #include <stdio.h> #include <fcntl.h>
int fh; long position;
fh = open ("data",ORDONLY); . . . position
= tell (fh); /* remember current position */ .
. . lseek (fh, position, 0); /* seek to previous
position */
Notes
This call must be compiled with the -dos flag.
Page 1 (printed 8/7/87)