I know about
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?
migrated from stackoverflow.com Dec 21 '11 at 6:42
This question came from our site for professional and enthusiast programmers.
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].