Get the process that changed FileInfo.lastAccessTime or FileInfo.lastWriteTime

Can I find the process that changed the FileInfo.lastAccessTime or FileInfo.lastWriteTime of the file?

+2


a source to share


2 answers


As David says, I don't think this is possible as I don't think this information is stored in any of the metadata for the files. However, you can do it somehow by enabling auditing, take a look at this link for more details (it's for XP, but should be similar for Vista and 7):



http://support.microsoft.com/kb/310399

+1


a source


As far as I know, all operating systems do not track this information for IO performance reasons.

You can implement a file watcher using FileSystemWatcher. Here's a very simple example:



http://www.csharphelp.com/2006/11/file-watcher-utility/

And then get a snapshot of the process from one of the event handlers

0


a source







All Articles