-1

According to the FileSystemWatcher documentation (see the quote below) when moving a folder OnChanged or OnRenamed must be raised.

https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.90).aspx

...To be notified that the contents of folders have been moved or copied into a watched folder, provide OnChanged and OnRenamed event handler methods as suggested in the following table.

But it doesn't! At least with my .NET 3.5 C# application. Can somebody confirm it?

Murat Korkmaz
  • 1,329
  • 2
  • 19
  • 37
  • Add some code in your question – Kalten Mar 18 '16 at 12:46
  • Are you working with a local or network file system? I've seen reports that FileSystemWatcher is (or at least, was) buggy for network. e.g. http://stackoverflow.com/questions/239988/filesystemwatcher-vs-polling-to-watch-for-file-changes – Joseph Simpson Mar 18 '16 at 13:39

1 Answers1

0

As far as I know, if you're moving directory from, let's say, “outside”, neither OnChanged nor OnRenamed will be raised. Maybe that's the case.

If a file is being copied or transferred into a watched directory, the OnCreated event will be raised immediately, followed by one or more OnChanged events.

Surfin Bird
  • 488
  • 7
  • 16