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

add created/modified/last accessed date #759

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZeroSkill1
Copy link
Contributor

@ZeroSkill1 ZeroSkill1 commented Jan 28, 2022

I know this isn't exactly a good idea.

As mentioned in issue #758, GodMode9 currently does not show file creation date. It shows whatever FatFs returns in FILINFO, which is creation date (in case of directories) and modification date (in case of files).

According to this document, it's possible to get:

  • Creation Date + Time
  • Modification Date + Time
  • Last Accessed Date (no Time here)

This may not seem like a good idea at first, but I got it working by modifying FatFs a tiny bit.
I made sure not to mess with anything that isn't related. I also made sure the dates are correct for drives and virtual drives, keeping the date that was previously intended to be shown.

FILINFO only stored one Date and Time, so the first thing I did was adding new fields to store the other Dates/Times.
Then, I made sure the Dates/Times were updated accordingly (for writes, file/dir creation, etc.).

This is what I got after that:
grafik

The data shown is identical to the data shown in the Windows Explorer "Properties" menu, so it is at the very least correct.
I have also tested the modified date, by creating a file, modifying it in the built in hex editor and saving it. The modified date/last access date is updated accordingly.

Overall it's a pretty minimal change. I understand that it may not be something you wish to add, but if it works, IMO, why not.

Let me know what you think.

Copy link

@eku eku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check your settings for code indentation and spaces versus tabs.

arm9/source/fatfs/ff.c Outdated Show resolved Hide resolved
@ZeroSkill1 ZeroSkill1 changed the title changes to add created/modified/last accessed date add created/modified/last accessed date Jan 28, 2022
@Wolfvak
Copy link
Collaborator

Wolfvak commented Jan 31, 2022

Honestly I'd feel far more comfortable if this were pushed to http://elm-chan.org/fsw/ff/bd/ and the original author merged it in themselves, then we can update the library and use it too.

@Wolfvak Wolfvak requested review from d0k3 and aspargas2 April 9, 2023 18:35
@d0k3
Copy link
Owner

d0k3 commented Apr 10, 2023

@Wolfvak - I'm still unsure about this one. While I like the functionality, and think @ZeroSkill1 did a good implementation here, it will make FATFS updating hard. However an update may not be required, as most recent updates in FATFS deals with ExFAT, which we're not really interested in. @aspargas2 - what do you think?

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.

None yet

4 participants