home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / sys / stat / filelen.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  664 b   |  28 lines

  1. @node filelength, io
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <io.h>
  6.  
  7. long filelength(int fhandle);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function returns the size, in bytes, of a file whose handle is
  13. specified in the argument @var{fhandle}.  To get the handle of a file
  14. opened by @ref{fopen} or @ref{freopen}, you can use @ref{fileno} macro.
  15.  
  16. @subheading Return Value
  17.  
  18. The size of the file in bytes, or (if any error occured) -1L and
  19. @var{errno} set to a value describing the cause of the failure.
  20.  
  21. @subheading Example
  22.  
  23. @example
  24.   printf("Size of file to which STDIN is redirected is %ld\n", 
  25.           filelength(0));
  26. @end example
  27.  
  28.