[Mono-dev] FAMWatcher race condition patch

Michael Schurter michael at synthesyssolutions.com
Tue Apr 11 09:58:38 EDT 2006

Gonzalo Paniagua Javier wrote:
> On Sun, 2006-04-09 at 16:37 +1200, Thong Nguyen wrote:
>> The FAM based FileSystemWatcher has problems monitoring directories
>> recursively because FAM doesn't support this natively.
>> FMAWatcher gets around this by telling FAM to monitor a subdirectory every
>> time a sub directory is created.  This will work but there is a race
>> condition that occurs when a sub directory is created and populated with
>> files before FAM is told to monitor the new sub directory.  This results in
>> files being created without the FSW raising the appropriate events.
>> For example:
>> If I'm monitoring the current dir and I do this:
>> mkdir a; touch a/pok
> [...]
> Your patch is now in svn.
> Thanks a lot.

I just wanted to say thanks as well.  I've used MS .Net's 
FileSystemWatcher in Windows with very disappointing results: Created 
events being fired twice, long running watchers magically dying, etc. 
Its exciting to see places where Mono is surpassing .Net's functionality 
and stability.

Michael Schurter

More information about the Mono-devel-list mailing list