FileSystemSafeWatcher icon indicating copy to clipboard operation
FileSystemSafeWatcher copied to clipboard

The class crashes if a file is added to a subfolder

Open ericcanadas opened this issue 1 year ago • 2 comments

Hi, When I add a file to a subfolder of the monitored folder with Filter = . and IncludeSubdirectories = false, the class crashes and causes an infinite loop.

watcher = new FileSystemWatcher("C:\TEST");
watcher.Filter = "*.*";
watcher.IncludeSubdirectories = false;
watcher.EnableRaisingEvents = true;

If Filter is on a specific extension like Filter = "*.csv", it's ok, but not with the combinaison of Filter= "*.*" and IncludeSubdirectories = false

ericcanadas avatar May 02 '24 13:05 ericcanadas

How Can I compile it? I tried like this: csc "C:\Users\usrtbest\Documents\scripts\tests\FileSystemSafeWatcher.cs" /r:AsaLib.dll but I got this error: error CS0006: Metadata file 'AsaLib.dll' could not be found and when I tried without the dll I got thousands of errors. Thank you in advance for your help. I am using windows server 2019, Microsoft (R) Visual C# Compiler version 4.7.3190.0 for C# 5

marseaplage avatar Jul 16 '24 15:07 marseaplage

Hi, I will test it tomorrow, I am sorry I haven't seen your issue since today

melenaos avatar Jul 16 '24 16:07 melenaos