Windows filesystem: Creation time of a file doesn't change when while is deleted and created again

I believe you are encountering a phenomenon in Windows known as filesystem tunneling. This is a feature of NT based systems wherein a new file with the same name as a recently deleted file in the same directory will inherit the creation time of the old file.

You can disable tunneling or alter the length of time for which the old file data is cached. See this Microsoft KB article for details.

Filesystem tunneling was implemented since many applications will delete and recreate files they wish to alter rather than merely update them.

You should be able to use @Jim Rhodes suggestion to counteract this feature.


You could use SetFileTime to update the create time as soon as you create the file.