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

Ilber Ibrahimi iibrahimi at solgenia.com
Wed Nov 16 11:01:43 EST 2011


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;

Funcitons:

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?

Thanks


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


More information about the Mono-list mailing list