melenaos / FileSystemSafeWatcher

Extends the FileSystemWatcher to trigger the events only when the file is ready for read
Apache License 2.0
34 stars 13 forks source link

The class crashes if a file is added to a subfolder #7

Open ericcanadas opened 3 months ago

ericcanadas commented 3 months ago

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

marseaplage commented 1 month ago

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

melenaos commented 1 month ago

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