Trying this I have found a strange problem:
- Delete an old file.
- Create a new file and name it the same as the old file.
Then the ‘created time’ property of the new file is set to the ‘created time’ of the old file. Why does that happen? And how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s due to file system tunnelling, as explained by Raymond Chen:
‘Why does tunneling exist at all?
When you use a program to edit an existing file, then save it, you expect the original creation timestamp to be preserved, since you’re editing a file, not creating a new one. But internally, many programs save a file by performing a combination of save, delete, and rename operations (such as the ones listed in the linked article), and without tunneling, the creation time of the file would seem to change even though from the end user’s point of view, no file got created.
As another example of the importance of tunneling, consider that file ‘File with long name.txt’, whose short name is say ‘FILEWI~1.TXT’. You load this file into a program that is not long-filename-aware and save it. It deletes the old ‘FILEWI~1.TXT’ and creates a new one with the same name. Without tunnelling, the associated long name of the file would be lost. Instead of a friendly long name, the file name got corrupted into this thing with squiggly marks. Not good.’