[Mono-list] FileSystemWatcher status

Stefano Incontri sincontr at yahoo.it
Thu Dec 22 05:27:08 EST 2005


>From the first tests, I can see that FileSystemWatcher perfectly works
with files or folders, but not with subdirectories.
I mean, if I set FileSystemWatcher.IncludeSubdirectories = true it hangs
up while receiving events from inside the first folder, with the
following exception :

Unhandled Exception: System.ArgumentOutOfRangeException: Index is less
than 0 or more than or equal to the list count.
Parameter name: index
4
in <0x00071> System.Collections.ArrayList:get_Item (Int32 index)
in <0x004c0> System.IO.FAMWatcher:ProcessEvents ()
in <0x00061> System.IO.FAMWatcher:Monitor ()
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()

Instead, if I disable subdirectories or copy only files, it works.
Could be helpful for you to understand the problem?

Thanks
Stefano

Il giorno gio, 22/12/2005 alle 09.51 +0100, Stefano Incontri ha scritto:
> I'm working on a local drive, but on Windows it works fine over network
> shares too.
> I noticed that sometimes the application blocks when setting the
> EnableRaisingEvents to true.
> Anyway since the application is a bit complex (it involves the
> ServiceProcess.ServiceBase class too), I'm going to test
> FileSystemWatcher writing the simplest code, and then growing it up.
> 
> Thanks, I'll let you know.
> 
> Stefano
> 
> Il giorno mer, 21/12/2005 alle 13.21 +0000, Bill Seddon ha scritto:
> > > Hi All, I'm testing a little application which keep aligned some files
> > > using the FileSystemWatcher facility, but I see that sometimes it
> > looses
> > > some event (file modification or new file creation).
> > > The same application, built under Windows, works fine instead.
> > > 
> > > Is mono's FileSystemWatcher reliable?
> > 
> > Are you watching a local drive or a network drive?  The reason for
> > asking is that I've found that the .NET FileSystemWatcher can appear to
> > be unreliable when working against a network drive.  Presumably it is to
> > do with network issues.
> > 
> > If your observations are related to a local drive then, OK, there may be
> > a problem with FileSystemWatcher.  If it's against a network drive, it
> > may be worth comparing the behaviour of both the .NET a Mono classes to
> > see if there is any similarities.
> > 
> > Bill Seddon
> > 
> > 
> 
> 
> 		
> ___________________________________ 
> Yahoo! Messenger: chiamate gratuite in tutto il mondo 
> http://it.messenger.yahoo.com
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


More information about the Mono-list mailing list