MCPcopy Create free account
hub / github.com/devkitPro/libctru / archive_getmtime

Function archive_getmtime

libctru/source/archive_dev.c:1330–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1328}
1329
1330Result
1331archive_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 */
1363typedef struct

Callers

nothing calls this directly

Calls 2

archive_utf16pathFunction · 0.85
FSUSER_ControlArchiveFunction · 0.85

Tested by

no test coverage detected