Skip to content

fix(Vfs): store the time of a mounted host file as Unix time - #137

Open
Reveares wants to merge 1 commit into
GothicKit:mainfrom
Reveares:fix/host-file-time
Open

Reveares wants to merge 1 commit into
GothicKit:mainfrom
Reveares:fix/host-file-time

Conversation

@Reveares

Copy link
Copy Markdown
Contributor

Fixes #136.

I went with time_tas you suggested. std::chrono didn't work out: on MSVC, clock_cast<system_clock> requires the time zone database through ICU and throws when icu.dll isn't there (Windows before 10 1903 and Wine). All that for just getting a Unix timestamp isn't worth it.

One related thing: mount_disk reads the archive's DOS date with mktime (local time), but Piranha Bytes stamped them in UTC. Each shipped Gothic II VDF's header comment contains its build time in GMT, e.g. "Gothic II - Textures (Thu, 07 Nov 2002 09:07:29 GMT)", and the header date matches it. save already writes UTC with gmtime. I'd suggest reading it as UTC as well. If you agree I can follow up with another PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mount_host stores file times in the file_clock epoch, archives use Unix time

1 participant