| 1328 | } |
| 1329 | |
| 1330 | Result |
| 1331 | archive_getmtime(const char *name, |
| 1332 | u64 *mtime) |
| 1333 | { |
| 1334 | Result rc; |
| 1335 | FS_Path fs_path; |
| 1336 | struct _reent r; |
| 1337 | archive_fsdevice *device = NULL; |
| 1338 | |
| 1339 | r._errno = 0; |
| 1340 | |
| 1341 | fs_path = archive_utf16path(&r, name, &device); |
| 1342 | if(r._errno != 0) |
| 1343 | errno = r._errno; |
| 1344 | |
| 1345 | if(fs_path.data == NULL) |
| 1346 | return -1; |
| 1347 | |
| 1348 | rc = FSUSER_ControlArchive(device->archive, ARCHIVE_ACTION_GET_TIMESTAMP, |
| 1349 | (void*)fs_path.data, fs_path.size, |
| 1350 | mtime, sizeof(*mtime)); |
| 1351 | if(rc == 0) |
| 1352 | { |
| 1353 | /* convert from milliseconds to seconds */ |
| 1354 | *mtime /= 1000; |
| 1355 | /* convert from 2000-based timestamp to UNIX timestamp */ |
| 1356 | *mtime += 946684800; |
| 1357 | } |
| 1358 | |
| 1359 | return rc; |
| 1360 | } |
| 1361 | |
| 1362 | /*! Error map */ |
| 1363 | typedef struct |
nothing calls this directly
no test coverage detected