tell

Determines the current file position

Local Servers:nonblocking
Remote Servers:nonblocking
Platform:NLM
Service:Operating System I/O

Syntax

  #include <nwfileio.h>  
   
  LONG tell  (  
     int   fildes);
  

Parameters

handle
(IN) Specifies a file handle.

Return Values

When an error occurs, a value of -1 is returned. Otherwise, the current file position is returned in a system-dependent manner. A value of 0 indicates the start of the file.

If an error occurs, errno is set to:

4

EBADF

Bad file number.

Remarks

The handle value is the file handle returned by a successful execution of the open, sopen, creat, or fileno function. This function can be used in conjunction with lseek to reset the current file position.

See Also

close, creat, eof, filelength, fileno, fstat, ftell, isatty, lseek, open, read, sopen, write

Example

  #include <fcntl.h>  
   
  LONG   position;  
  int    handle;  
  position = tell (handle);