Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I know about ctime and mtime and that their behavior is platform dependent. As I understand it, *nix does not have any way of keeping track of file creation time. Is this a historical accident? If it's a technically difficult problem, what makes it so?

share|improve this question

migrated from stackoverflow.com Dec 21 '11 at 6:42

1 Answer

For one thing, it's poorly defined. If you copy [or zip and unzip] a file, do you want the creation time on the new file to be set to that of the original file or not? If so, or if you want it to be an option, you have to write all those utilities around that (though most already have code to preserve mtime).

It's not useful in the majority of cases [do you really need to know when all the files in /bin were created?], or wasn't at the time Unix was first designed, and it would cost four bytes that have to come out of somewhere in the (fixed-size, 64 bytes) inode structure [probably the block list, which means 512 less bytes a file can grow before using indirect blocks].

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.