home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixtools / util / c / filelen < prev    next >
Encoding:
Text File  |  1992-07-21  |  281 b   |  20 lines

  1. /* C.FileLen: Return file length */
  2.  
  3. #include "kernel.h"
  4. #include "utils.h"
  5.  
  6. #define ReadCat    5
  7.  
  8. off_t filelen (const char *file)
  9. {
  10.     int type;
  11.     _kernel_osfile_block osfile;
  12.  
  13.     type = _kernel_osfile(ReadCat, file, &osfile);
  14.  
  15.     if (type != 1)
  16.         return 0;
  17.     else
  18.         return osfile.start;
  19. }
  20.