2021-07-13 00:49:51 +02:00
|
|
|
#include <syscall.h>
|
2010-02-12 21:11:35 +01:00
|
|
|
|
2021-07-13 00:49:51 +02:00
|
|
|
#pragma pack(push,1)
|
2010-02-12 21:11:35 +01:00
|
|
|
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)
|
|
|
|
|
2021-07-13 00:49:51 +02:00
|
|
|
int get_fileinfo(const char *path, FILEINFO *info)
|
2010-02-12 21:11:35 +01:00
|
|
|
{
|
2021-09-10 20:50:14 +02:00
|
|
|
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;
|
2021-07-13 01:07:50 +02:00
|
|
|
return FS_Service(&k, &err);
|
2021-07-13 00:49:51 +02:00
|
|
|
}
|