Search code examples
windowscachingcopyfilesystemsdrive

Is there something that caches deleted files for a period of time on the drive?


I am having problems determining the creation time of a file.

When I copy a file from one folder to another and delete the original file, the copy gets a new created date. If I copy the copy back to the original path, the new copy, which is now back in the original path, gets the old creation date from before the deletion.

Example:

  • File1 creation date 15.05.2022 13:12 (path: C:\Desktop)
  • File1 copied to File2 path (C:\Desktop\Test)
  • File2 creation date and creation time: 15/07/2024 10:59
  • File1 deleted from C:\Desktop
  • File2 copied from C:\Desktop\Test to C:\Desktop
  • File2 now has creation data again 15.05.2022 13:12

Windows specs:

  • Edition: Windows 10 Pro
  • Version: 22H2
  • Installed at: ‎31.‎03.‎2021
  • OS-Build: 19045.4651
  • Pack: Windows Feature Experience Pack 1000.19060.1000.0

I guess something is stored in the cache. How can I stop this behaviour?

I was expecting the file to get a new creation date because it has been deleted.


Solution

  • It's not exactly the cache of files, but yes, the filesystem does keep the information about the deleted files for some time (about 15 seconds). The purpose is to restore the old creation date when a file gets overwritten - this is exactly what you are experiencing. Here's an explanation with links: https://stackoverflow.com/a/8810634/47961