J
Josh Usovsky
I'm setting up a watched folder using FileSystemWatcher.
When I drop a small file into the watched folder, I can
respond to a .Created event and process the file with
other code. However, if I try copying a large file into
the watched folder, the .Created event is fired off
immediately and not when the file is finished copying. I
have tried waiting for a certain number of .Changed
events to be fired after the initial .Created event, and
that method works greate except for the fact that some
files trigger 3 .Changed events, and others 5, 6, and 7.
I can't find a pattern to determine why there are a
differing number of events being fired for the various
files. Does anyone else have experience in this or have
any suggestions for determining when each file is
finished being written ? I'd rather not use a checking
loop or error handling for program flow, but I might have
to at this point.
Thanks in advance,
--JU
When I drop a small file into the watched folder, I can
respond to a .Created event and process the file with
other code. However, if I try copying a large file into
the watched folder, the .Created event is fired off
immediately and not when the file is finished copying. I
have tried waiting for a certain number of .Changed
events to be fired after the initial .Created event, and
that method works greate except for the fact that some
files trigger 3 .Changed events, and others 5, 6, and 7.
I can't find a pattern to determine why there are a
differing number of events being fired for the various
files. Does anyone else have experience in this or have
any suggestions for determining when each file is
finished being written ? I'd rather not use a checking
loop or error handling for program flow, but I might have
to at this point.
Thanks in advance,
--JU