Folder watcher in DOT NET Core
File System events monitoring program in C#. In this example we have used Dot Net Core worker template for creating the background service program for monitoring files inside the watcher folder.
Events are like
Create
Change
Delete
Rename
Reference Link.
imstalin.github.io/coderepo/2...
Пікірлер: 8
Thanks from Brazil!!
Will it run on docker windows container?
Why was the FileSystemWatcher created in the loop. Can we not create a Singleton so a file system watcher does not get created in each interation.
@nicojmb
2 жыл бұрын
Same question here, why the code is insde the loop?
@CreativPret
2 жыл бұрын
You are correct. It does not need to be in the loop. (The guys who write code like this would never pass first round of interview where I work ) :)
You are too good... Nice Explanation... I have one question. How you manage the event. I am doing the same thing which you showing but when i copy file to the watcher folder in multiple time event is invoked. It will not fire event single time. In your demo it is single time. So how you do that?
when i run it, it logs multiple console messages for a single event.
@alez9456
2 жыл бұрын
Hi! Do you resolve it?