Search code examples
windowsfilefilesystemscygwindirectory

How to get date/time when file was placed in a directory on Windows?


Is there a way to tell when a file was moved to a certain directory?

I'm being asked why a script of mine did not find a file in a certain directory. The file was created last January but I suspect it was placed in the directory after the script was run. Is there a way for me to confirm my suspicion?

Viewing the file properties gives me the created, modified, and accessed times, and the first two do not change when moving files from one directory to another.


EDIT: I have cygwin installed, if that helps at all. Is there a unix way of determining when a directory entry was created?


Solution

  • If the file in question can be shown to have been the last file added to that directory, you can look at the last modified date of the directory itself, since directories are modified when files are inserted into them. Otherwise, I don't hold much hope.