[Mono-list] FileSystemWatcher.IncludeSubdirectories breaks watcher?

Adam Tauno Williams awilliam at whitemice.org
Tue Apr 24 14:47:31 UTC 2012


I'm testing out using FileSystemWatcher in an app.  It works, but the
moment I uncomment "watcher.IncludeSubdirectories = true" I no longer
get events (and no error occurs).

        FileSystemWatcher watcher = new FileSystemWatcher();
        watcher.Path = @"/home/awilliam/tmp";
        watcher.Renamed += new RenamedEventHandler(watcher_Renamed);
        watcher.Changed += new FileSystemEventHandler(watcher_Changed);
        watcher.Created += new FileSystemEventHandler(watcher_Created); 
        watcher.Deleted += new FileSystemEventHandler(watcher_Deleted); 
        watcher.EnableRaisingEvents = true;
        //watcher.IncludeSubdirectories = true;

Is this expected?

-- 
Adam Tauno Williams <awilliam at whitemice.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120424/01612c26/attachment.pgp>


More information about the Mono-list mailing list