home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / fstat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  644 b   |  33 lines

  1.  
  2. /*
  3.  * Get file statistics - sort of like stat(2)
  4.  */
  5.  
  6. int st_fstat(fname, buf)
  7. char *fname;
  8. struct stat *buf;
  9. {
  10.     register struct stat *save_dta;
  11.     register int status;
  12.  
  13.     /* Save old DTA */
  14. /*    save_dta = (struct stat *)Fgetdta();    */
  15.     save_dta = trap_1_wlww(0x2F);
  16.  
  17.     /* set the new DTA */
  18. /*    Fsetdta(buf);                */
  19.     trap_1_wlww(0x1A, buf);
  20.  
  21.     /* Find file stat */
  22. /*    status = Fsfirst(fname, 0);        */
  23.     status = trap_1_wlww(0x4E, fname, 0);
  24.  
  25.     /* reset dta */
  26. /*    Fsetdta(save_dta);            */
  27.     trap_1_wlww(0x1A, save_dta);
  28.  
  29.     /* return status */
  30.     return (status == 0) ? 0 : -1;
  31.  
  32. }
  33.