home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / TELL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.1 KB  |  41 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - tell.c
  3.  *
  4.  * function(s)
  5.  *        tell - gets current position of file pointer
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <io.h>
  18.  
  19. /*---------------------------------------------------------------------*
  20.  
  21. Name            tell - gets current position of file pointer
  22.  
  23. Usage           long tell(int handle);
  24.  
  25. Prototype in    io.h
  26.  
  27. Description     gets the current position of the file pointer associated
  28.                 with handle and expresses it as the number of bytes from
  29.                 the beginning of the file.
  30.  
  31. Return value    the current file pointer position.  A return of -1L
  32.                 indicates an error, and errno is set to:
  33.  
  34.                         EBADF   Bad file number
  35.  
  36. *---------------------------------------------------------------------*/
  37. long tell(int handle)
  38. {
  39.         return (lseek (handle, 0L, SEEK_CUR));
  40. }
  41.