473,513 Members | 3,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system.IO: alternatives to fileSystemWatcher approach

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

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #1
1 3136
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

"chris yoker via DotNetMonster.com" wrote:
Community Message Not Available

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9066
by: Josh Usovsky | last post by:
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...
3
9443
by: Michael Stanbrook | last post by:
I'm using the FileSystemWatcher to looks for new files arriving in a directory. Files are coming in via FTP and tend to be larger is size (> 1MB at least). I would like to fire an event once the file is completely written. I understand there is nothing "exactly" like that due to how the OS filesystem works, so I am looking for a...
7
4096
by: Allen Anderson | last post by:
I'm trying to figure out a way to catch when a file has been written to a directory. I currently have it where I can catch when the file begins writing, but this isn't helpful as I need to know when its done. Does anyone know the right combination of flags to use to catch when the file has been written and closed? (here is my current code)....
2
3299
by: Jack David | last post by:
Using the code below I am able to monitor a single directory for a new file and then kick-off a process to deal with the file. The question is??? How would I modify this code to be able to monitor a couple of different directories and based upon the directory where the new file is created kick-off a process Example: File A in Directory B...
2
2479
by: Nony Buz | last post by:
My objective is simply: Notify a form when a image file has been created in a directory. First there is a basic interface for the callback function: public interface INewImageNotify { void notify_NewImage(string imageName); } Then there is the delegate:
1
360
by: chris yoker via DotNetMonster.com | last post by:
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...
5
5122
by: Philip Wagenaar | last post by:
I have a Windows Form application that monitors a directory using the System.IO.FileSystemWatcher. On the event created I run a sub that sends an xml file over http to a service. When I copy 7000 files in the directory to be monitored only 123 are sent to the service. What might be going wrong?
3
9788
by: emailtonitin | last post by:
I am facing a design issue in my code related to the filesystemwatcher's filter property. I figured out that the filter won't accept multiple patterns for eg. "*.txt, *.csv" don't work. To workaround this issue, I have 2 options: 1. To create multiple instances of filesystemwatcher class and hook all of them to the same event handlers. 2....
2
3471
by: John Talli | last post by:
System.IO.FileSystemWatcher When a user copies and pastes a file from one directory to a directory that is monitored by the FileSystemWatcher, the FileSystemWatcher executes twice, once for a CREATED file event and once for a CHANGED file event. I think I understand why. First the monitored file is created and then contents are inserted...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.