home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / ramfs102.zip / src / fileinfo.c < prev    next >
C/C++ Source or Header  |  2002-09-28  |  932b  |  44 lines

  1. #include "includes.h"
  2.  
  3.  
  4.  
  5.  
  6.  
  7. APIRET EXPENTRY FS_FILEINFO (
  8.     USHORT    flag,
  9.     struct sffsi *psffsi,
  10.     struct sffsd *psffsd,
  11.     USHORT    level,
  12.     PCHAR    pData,
  13.     USHORT    cbData,
  14.     USHORT    IOflag )    /* not used */
  15. {
  16.   int       rc;
  17.   POPENFILE pOpenfile;
  18.   DIRENTRY  Entry;
  19.  
  20.   UtilEnterRamfs();
  21.   DEBUG_PRINTF3 ("FS_FILEINFO  sfn=%d, flag=%d, level=%d",
  22.          psffsi->sfi_selfsfn, flag, level);
  23.  
  24.   pOpenfile = psffsd->pOpenfile;
  25.   VMRead (&Entry, pOpenfile->flatEntry, sizeof(Entry)-sizeof(Entry.achName));
  26.  
  27.   if (flag == 0)
  28.   {
  29.     /* retrieve information */
  30.     rc = InfoQuery (pData, cbData, level, &Entry);
  31.   }
  32.   else
  33.   {
  34.     /* set information */
  35.     rc = InfoSet (pData, cbData, level, &Entry, psffsi);
  36.     if (rc == NO_ERROR)
  37.       VMWrite (pOpenfile->flatEntry, &Entry, sizeof(Entry)-sizeof(Entry.achName));
  38.   }
  39.  
  40.   DEBUG_PRINTF1 (" => %d\r\n", rc);
  41.   UtilExitRamfs();
  42.   return rc;
  43. }
  44.