Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are windows file creation timestamps reliable?

Tags:

file

windows

I have a program that uses save files. It needs to load the newest save file, but fall back on the next newest if that one is unavailable or corrupted. Can I use the windows file creation timestamp to tell the order of when they were created, or is this unreliable? I am asking because the "changed" timestamps seem unreliable. I can embed the creation time/date in the name if I have to, but it would be easier to use the file system dates if possible.


1 Answers

If you have a directory full of arbitrary and randomly named files and 'time' is the only factor, it may be more pointful to establish a filename that matches the timestamp to eliminate need for using tools to view it.

2008_12_31_24_60_60_1000  

Would be my recommendation for a flatfile system.

Sometimes if you have a lot of files, you may want to group them, ie:

2008/
2008/12/
2008/12/31
2008/12/31/00-12/
2008/12/31/13-24/24_60_60_1000 

or something larger

2008/
2008/12_31/

etc etc etc.

( Moreover, if you're not embedding the time, what is your other distinguishing characteritics, you cant have a null file name, and creating monotonically increasing sequences is way harder ? need info )

like image 81
Kent Fredric Avatar answered Oct 22 '25 18:10

Kent Fredric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!