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

Any way to set the modification time of a file? #508

Open
yossariano opened this issue Sep 15, 2022 · 2 comments
Open

Any way to set the modification time of a file? #508

yossariano opened this issue Sep 15, 2022 · 2 comments

Comments

@yossariano
Copy link

Hello-

I'm working on a program which syncs retroarch save files between a remote service and my 3DS by comparing timestamps. I have everything working pretty nicely at the moment except that I am unable to set the modification time of a downloaded file to match the time that was on the server, so the local files end up having the current timestamp instead of the last modified time of the file on the server, which screws things up for when we try to sync next since it then tries to upload the "newer" file.

utime() and utimes() fail with "function not implemented". Fair enough- I was wondering if anyone has any ideas on how to go about doing this since I cannot use the usual approach. archive_getmtime works brilliantly for getting the local file mod time, but there is no corresponding archive_setmtime. I've tried following the code to see how to go about implementing that but I fear it is a bit above my paygrade.

Is there any known way of modifying the mtime of a file on the 3DS sdmc in code? If not, I would like to request such a feature be added (if it is impossible for some reason, no worries).

@szclsya
Copy link

szclsya commented Feb 22, 2023

Same problem here. Seems that it's only possible to fetch mtime but no way to write it.

Just read some documentation on the fs subsystem. Is it a limitation on the OS's side?

@mtheall
Copy link
Contributor

mtheall commented Feb 22, 2023

That's correct. The OS only has an API to retrieve the mtime of a file. The only way to update the mtime is to open the file with FS_WRITE_UPDATE_TIME which updates the file's mtime to the current time when written to.

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

No branches or pull requests

3 participants