|
|
| version 1.3, 2004/01/23 17:37:39 | version 1.5, 2005/05/20 17:25:03 |
|---|---|
| Line 170 short file_getdatetime(FILEH handle, DOS | Line 170 short file_getdatetime(FILEH handle, DOS |
| FSRef ref; | FSRef ref; |
| FSCatalogInfo fsci; | FSCatalogInfo fsci; |
| LocalDateTime ldt; | |
| DateTimeRec dtr; | |
| ZeroMemory(&dtr, sizeof(dtr)); | |
| if ((FSGetForkCBInfo(handle, 0, NULL, NULL, NULL, &ref, NULL) != noErr) || | if ((FSGetForkCBInfo(handle, 0, NULL, NULL, NULL, &ref, NULL) != noErr) || |
| (FSGetCatalogInfo(&ref, kFSCatInfoContentMod, &fsci, NULL, NULL, NULL) | (FSGetCatalogInfo(&ref, kFSCatInfoContentMod, &fsci, NULL, NULL, NULL) |
| != noErr)) { | != noErr)) { |
| return(-1); | return(-1); |
| } | } |
| ConvertUTCToLocalDateTime(&fsci.contentModDate, &ldt); | cnvdatetime(&fsci.contentModDate, dosdate, dostime); |
| SecondsToDate(ldt.lowSeconds, &dtr); | |
| if (dosdate) { | |
| dosdate->year = dtr.year; | |
| dosdate->month = (BYTE)dtr.month; | |
| dosdate->day = (BYTE)dtr.day; | |
| } | |
| if (dostime) { | |
| dostime->hour = (BYTE)dtr.hour; | |
| dostime->minute = (BYTE)dtr.minute; | |
| dostime->second = (BYTE)dtr.second; | |
| } | |
| return(0); | return(0); |
| #else | #else |
| (void)handle; | (void)handle; |
| Line 452 void file_catname(char *path, const char | Line 438 void file_catname(char *path, const char |
| } | } |
| } | } |
| char *file_getname(char *path) { | char *file_getname(const char *path) { |
| char *ret; | const char *ret; |
| ret = path; | ret = path; |
| while(*path != '\0') { | while(*path != '\0') { |
| Line 462 char *file_getname(char *path) { | Line 448 char *file_getname(char *path) { |
| ret = path; | ret = path; |
| } | } |
| } | } |
| return(ret); | return((char *)ret); |
| } | } |
| void file_cutname(char *path) { | void file_cutname(char *path) { |
| Line 473 void file_cutname(char *path) { | Line 459 void file_cutname(char *path) { |
| p[0] = '\0'; | p[0] = '\0'; |
| } | } |
| char *file_getext(char *path) { | char *file_getext(const char *path) { |
| char *p; | char *p; |
| char *q; | char *q; |