DEV Community

Discussion on: Why you shouldn't use the file creation time to represent a date

Collapse
 
pentacular profile image
pentacular

File creation time should never be used for anything other than relative staleness checks.

If it's a meaningful part of the file content, it had better be part of the file content. :)

Collapse
 
alexabruck profile image
Alexa Steinbrück

You're absolutely right! I updated this posts title to account for this more general truth. Your comment can stay how it is, it still makes sense :-D

Collapse
 
alexabruck profile image
Alexa Steinbrück

Just curious: What do you consider a 'staleness check'? (when would you do that)? Thanks!

Collapse
 
pentacular profile image
pentacular

Let's say that one file is produced from another.

It is never incorrect to regenerate it, but unnecessary unless the other file has since been modified.

Or say that the file is sufficiently up to date not to regenerate if it was modified less than some time ago.

Thread Thread
 
alexabruck profile image
Alexa Steinbrück

I see, thanks!