Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32/File.cpp: utime: fallback to 01/01/1980 00:00:00 if the date is too low #14019

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

Megamouse
Copy link
Contributor

Apparently on exfat and fat the minimum date is 01/01/1980 00:00:00.

This is just a proof of concept for #14015.
This should probably be logged and also done for linux in some way.

Tagging @Nekotekina for alternative solutions.

@Nekotekina
Copy link
Member

Maybe we should deprecate using these filesystems?

@Nekotekina
Copy link
Member

I tested on Linux/exFAT: utime already does this on Linux if the time is too low

@elad335
Copy link
Contributor

elad335 commented Jun 16, 2023

I think on all platforms and all filesystems fs::utime(<1980) should fail then, not only Windows. You are trying to fix a PS3 filesystem issue by hacking the host.

@Nekotekina
Copy link
Member

It shouldn't fail, it's actually normal behaviour to approximate timestamps which don't fit into FS specific range. This PR makes this consistent so it's mergeable as is.

@elad335
Copy link
Contributor

elad335 commented Jun 16, 2023

There is little to no use in RPCS3 to modify file time in any case if it wasn't for PS3 filesystem implementation, so the implementation should not allow to use host if it cannot perform the functionality needed for the PS3 implementation to be accurate. I've implemented emulated file times in #14033. (without the true filesystem barriers yet)

@elad335
Copy link
Contributor

elad335 commented Jun 16, 2023

Doing what host filesystems do for ps3 code is like abiding a different country's laws and be surprised you end up being fined or in prison

@Nekotekina
Copy link
Member

You can always put 1980 check in sys_fs.

@elad335
Copy link
Contributor

elad335 commented Jun 16, 2023

But who wants to fix an issue that has already been hacked?

@Megamouse Megamouse force-pushed the asasd branch 2 times, most recently from 7581135 to 2441692 Compare July 31, 2023 17:47
@elad335 elad335 marked this pull request as ready for review September 3, 2023 18:12
@elad335 elad335 changed the title fs::utime: fallback to 01/01/1980 00:00:00 if the date is too low Win32/File.cpp: utime: fallback to 01/01/1980 00:00:00 if the date is too low Sep 4, 2023
@elad335 elad335 merged commit 6bc7d7c into RPCS3:master Sep 4, 2023
1 of 6 checks passed
@Megamouse Megamouse deleted the asasd branch September 4, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants