Subversion Repositories Kolibri OS

Rev

Rev 9057 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <syscall.h>
  2.  
  3. #pragma pack(push,1)
  4. typedef struct
  5. {
  6.   char sec;
  7.   char min;
  8.   char hour;
  9.   char rsv;
  10. }detime_t;
  11.  
  12. typedef struct
  13. {
  14.   char  day;
  15.   char  month;
  16.   short year;
  17. }dedate_t;
  18.  
  19. typedef struct
  20. {
  21.   unsigned    attr;
  22.   unsigned    flags;
  23.   union
  24.   {
  25.      detime_t  ctime;
  26.      unsigned  cr_time;
  27.   };
  28.   union
  29.   {
  30.      dedate_t  cdate;
  31.      unsigned  cr_date;
  32.   };
  33.   union
  34.   {
  35.      detime_t  atime;
  36.      unsigned  acc_time;
  37.   };
  38.   union
  39.   {
  40.      dedate_t  adate;
  41.      unsigned  acc_date;
  42.   };
  43.   union
  44.   {
  45.      detime_t  mtime;
  46.      unsigned  mod_time;
  47.   };
  48.   union
  49.   {
  50.      dedate_t  mdate;
  51.      unsigned  mod_date;
  52.   };
  53.   unsigned    size;
  54.   unsigned    size_high;
  55. } FILEINFO;
  56. #pragma pack(pop)
  57.  
  58. int get_fileinfo(const char *path, FILEINFO *info)
  59. {
  60.    ksys70_t k;
  61.    int err;
  62.    k.p00 = 5;
  63.    k.bdfe = info;
  64.    k.p20 = 0;
  65.    k.p21 = path;
  66.    return FS_Service(&k, &err);
  67. }
  68.  
  69.