FileSystemWatcher Work is Done?
Posted
by
Snowy
on Stack Overflow
See other posts from Stack Overflow
or by Snowy
Published on 2011-01-11T21:31:03Z
Indexed on
2011/01/11
21:53 UTC
Read the original article
Hit count: 188
I setup a FsWatcher on a local filesystem directory. I only want to know when files are added to the directory so they can be moved to another filesystem. I seem to be able to detect when the first file is in, but actually I want to know when all files from a given copy operation are done.
If I used Windows Explorer to copy files from one directory to another, Explorer would tell me that there are n seconds left in the transfer, so while there is some activity for the begin-transfer and end-transfer for each file, it appears that there is something for the begin-transfer and end-transfer for all files.
I wonder if there is something similar that I can do just with the .NET Framework. I would like to know when "all" files are in and not just a single file in a "transaction". If there is nothing baked in, maybe I should come up with some kind of waiting/countering in order to only do my activity when a job is "done".
Not sure if I'm making 100% sense on this one, please anyone comment.
Thanks.
© Stack Overflow or respective owner