[Mono-list] FileSystemWatcher does not fire on Mac OS X

Ilber Ibrahimi iibrahimi at solgenia.com
Wed Nov 16 11:46:13 EST 2011

I wrote a simple console app with mono develop and i foud that the problem is with the property IncludeSubdirectories.
The FileSystemWatcher fire only on the parent dir and not in the subdirectories :).

I'm the only one that I have this error?

From: mono-list-bounces at lists.ximian.com [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Ilber Ibrahimi
Sent: mercoledì 16 novembre 2011 17:02
To: mono-list at lists.ximian.com
Subject: [Mono-list] FileSystemWatcher does not fire on Mac OS X

Hi you all,
I have a little application that monitor changes on a specified folder. In Windows everything works fine but when I try under Mac OS X Snow Leopard the FileSystemWatcher does not fire.
This is the definition of the watchers:

FileSystemWatcher  _Watcher = new FileSystemWatcher(Program._FBServer.FreeBoxFolder);
_Watcher.InternalBufferSize = 5000000;
_Watcher.IncludeSubdirectories = true;
_Watcher.Created += new FileSystemEventHandler(OnChanged);
_Watcher.Renamed += new RenamedEventHandler(OnRenamed);
_Watcher.Changed += new FileSystemEventHandler(OnChanged);
_Watcher.Deleted += new FileSystemEventHandler(OnChanged);
_Watcher.EnableRaisingEvents = true;


private void OnChanged(object source, FileSystemEventArgs e)
     // Specify what is done when a file is changed, created, or deleted.
     Console.WriteLine("File: " + e.FullPath + " " + e.ChangeType);

private void OnRenamed(object source, RenamedEventArgs e)
    // Specify what is done when a file is renamed.
    Console.WriteLine("File: {0} renamed to {1}", e.OldFullPath, e.FullPath);

Can anyone help me please?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20111116/73ae48f0/attachment.html 

More information about the Mono-list mailing list