system.IO: alternatives to fileSystemWatcher approach

  • Thread starter Thread starter chris yoker via DotNetMonster.com
  • Start date Start date
C

chris yoker via DotNetMonster.com

hiya,

I am using a fileSystemWatcher to monitor a directory.When files are
inserted into the dir, I process them, via a call to my
"processAlllDirFiles" method.

If there is going to be a lot of file activity, is it better to perhaps use
a timer ( to decrease the frequency of times that my "processAlllDirFiles"
method is called?)...Or, do I just wait and see how I go regrding
performance?

All suggestions welcone ;-)

cheers,
yogi
 
hi chris,

I have had a slight performance hit when i tried to call some function on
change of every file, the way i handled it was like this,
I had a counter or something similar, I call a function "XYZ()" for
processing after a couple of files are changed, say i check for some 25 times
the filesystemwatcher is invoked then once the number reaches my max limit i
call a function to process my changed files.

Hope this helps you,
Kannan.V
 
Back
Top