d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.12k stars 191 forks source link

add created/modified/last accessed date #759

Open ZeroSkill1 opened 2 years ago

ZeroSkill1 commented 2 years ago

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:

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.

Wolfvak commented 2 years ago

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.

d0k3 commented 1 year ago

@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?