* make vfs::Entry time stamps consistent (as Windows FILETIME)
This commit is contained in:
parent
2a2b7ae8f7
commit
0d8a81137c
|
@ -127,9 +127,11 @@ bool DiscImageDevice::ReadEntry(ParseState* state, const uint8_t* buffer,
|
||||||
entry->attributes_ = attributes | kFileAttributeReadOnly;
|
entry->attributes_ = attributes | kFileAttributeReadOnly;
|
||||||
entry->size_ = length;
|
entry->size_ = length;
|
||||||
entry->allocation_size_ = xe::round_up(length, bytes_per_sector());
|
entry->allocation_size_ = xe::round_up(length, bytes_per_sector());
|
||||||
entry->create_timestamp_ = 0;
|
|
||||||
entry->access_timestamp_ = 0;
|
// Set to January 1, 1601 (UTC) in 100-nanosecond intervals
|
||||||
entry->write_timestamp_ = 0;
|
entry->create_timestamp_ = 10000 * 11644473600000LL;
|
||||||
|
entry->access_timestamp_ = 10000 * 11644473600000LL;
|
||||||
|
entry->write_timestamp_ = 10000 * 11644473600000LL;
|
||||||
|
|
||||||
if (attributes & kFileAttributeDirectory) {
|
if (attributes & kFileAttributeDirectory) {
|
||||||
// Folder.
|
// Folder.
|
||||||
|
|
|
@ -184,9 +184,11 @@ StfsContainerDevice::Error StfsContainerDevice::ReadAllEntries(
|
||||||
}
|
}
|
||||||
entry->size_ = file_size;
|
entry->size_ = file_size;
|
||||||
entry->allocation_size_ = xe::round_up(file_size, bytes_per_sector());
|
entry->allocation_size_ = xe::round_up(file_size, bytes_per_sector());
|
||||||
entry->create_timestamp_ = update_timestamp;
|
|
||||||
entry->access_timestamp_ = access_timestamp;
|
// Convert to 100-nanosecond intervals since January 1, 1601 (UTC)
|
||||||
entry->write_timestamp_ = update_timestamp;
|
entry->create_timestamp_ = (update_timestamp + 11644473600000LL) * 10000;
|
||||||
|
entry->access_timestamp_ = (access_timestamp + 11644473600000LL) * 10000;
|
||||||
|
entry->write_timestamp_ = (update_timestamp + 11644473600000LL) * 10000;
|
||||||
all_entries.push_back(entry.get());
|
all_entries.push_back(entry.get());
|
||||||
|
|
||||||
// Fill in all block records.
|
// Fill in all block records.
|
||||||
|
|
Loading…
Reference in New Issue