Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2007

Tip: Looking for answers? Try searching our database.

FileSystemWatcher-Loosing events?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonte - 15 Aug 2007 10:18 GMT
I am using fileSystemWatcher to monitor a directory on a file server. I am
looking for zip files. When a zip file arrives the watcher event is trigged
an I can unzip the file and then delete it. A very simple application but...I
have a problem. When I copy say 10 zip files at once into the watched
directory a problem occure. What I can se som create events are missed? Is
there a max buffer limit. No error is created by fileSystemWatcher. I used
this watcher instead of a timer to win some unwanted processing time
(polling).

Is there a solution for this I want to know it :)

//Jonte
UL-Tomten - 15 Aug 2007 10:52 GMT
> I am using fileSystemWatcher to monitor a directory on a file server.

A remote server?

Could you show some code?

When you read the MSDN FileSystemWatcher documentation, you saw that
there is an internal buffer that can silently overflow. The usual
method for keeping this from happening is increasing the buffer size,
watching for less changes. Could you try that and see if it makes any
difference?
Michael D. Ober - 15 Aug 2007 18:55 GMT
I have the same problem, regardless of buffer size.  There is an event for
the buffer overflow and I never receive it even though I still miss and
occasional FSW event.

The issue is that the underlying API follows the following logic:

Set FSW and wait for event
On event, handle the event
Set FSW and wait for event.

It appears that the event handler in .NET occurs before the FSW is set for
the next event, so if you have a long event handler, you will indeed lose
events.

Mike Ober.

>> I am using fileSystemWatcher to monitor a directory on a file server.
>
[quoted text clipped - 7 lines]
> watching for less changes. Could you try that and see if it makes any
> difference?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.