Watching Directory
-
Hi All, Is there any better and reliable method to watch for directories then filesystemwatcher.I am watching all files and folders on fixed drives.The behaviour of filesystemwatcher is different for different files for example for a .txt file if something is changed it fires the change event two times.for .xls file change event will fire even if it had been just opened also sometimes it shows it as deleted and then renamed when there is nothing being changed in the file.for .mdb file the creation and change both event fires just on creation.Is there any other reliable method.Thanks in advance.
-
Hi All, Is there any better and reliable method to watch for directories then filesystemwatcher.I am watching all files and folders on fixed drives.The behaviour of filesystemwatcher is different for different files for example for a .txt file if something is changed it fires the change event two times.for .xls file change event will fire even if it had been just opened also sometimes it shows it as deleted and then renamed when there is nothing being changed in the file.for .mdb file the creation and change both event fires just on creation.Is there any other reliable method.Thanks in advance.
This is not because the FileSystem watch treats different file types differently. You're actually getting some insights as to how those applications really behave! No matter what you use to monitor the file system, you'll see the same behaviors. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
This is not because the FileSystem watch treats different file types differently. You're actually getting some insights as to how those applications really behave! No matter what you use to monitor the file system, you'll see the same behaviors. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
hi dave, thanks for that information.Actually I want to know when a particular file is being modified.even the File.GetLastWriteTime does not help as in the case of .xls file it gives me the last access time.and there are other files type also.is there any way by which i can find whenever any file is being modified.thanks in advance.
-
hi dave, thanks for that information.Actually I want to know when a particular file is being modified.even the File.GetLastWriteTime does not help as in the case of .xls file it gives me the last access time.and there are other files type also.is there any way by which i can find whenever any file is being modified.thanks in advance.
"Being modified" can't be tracked. In the case of Notepad, it opens the file, reads it, then closes it. When the file is saved, the filename is opened, written, then closed. That's it. Excel/Word is almost the same way, but they involve saving to temp files, deleting the originals, and renaming the temps file to the old filenames. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome