home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / TELL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.5 KB  |  42 lines

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