kolibrios/drivers/ddk/io/finfo.c
turbocat 80647f2201 libddk: fixed io functions
git-svn-id: svn://kolibrios.org@9186 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-09-10 18:50:14 +00:00

71 lines
1020 B
C

#include <syscall.h>
#pragma pack(push,1)
typedef struct
{
char sec;
char min;
char hour;
char rsv;
}detime_t;
typedef struct
{
char day;
char month;
short year;
}dedate_t;
typedef struct
{
unsigned attr;
unsigned flags;
union
{
detime_t ctime;
unsigned cr_time;
};
union
{
dedate_t cdate;
unsigned cr_date;
};
union
{
detime_t atime;
unsigned acc_time;
};
union
{
dedate_t adate;
unsigned acc_date;
};
union
{
detime_t mtime;
unsigned mod_time;
};
union
{
dedate_t mdate;
unsigned mod_date;
};
unsigned size;
unsigned size_high;
} FILEINFO;
#pragma pack(pop)
int get_fileinfo(const char *path, FILEINFO *info)
{
int err;
ksys70_t k;
k.p00 = 5;
k.p04dw = 0;
k.p08dw = 0;
k.p12 = 0;
k.bdfe = info;
k.p20 = 0;
k.p21 = path;
return FS_Service(&k, &err);
}