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: [email protected] 
[mailto:[email protected]] On Behalf Of Ilber Ibrahimi
Sent: mercoledì 16 novembre 2011 17:02
To: [email protected]
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;

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


_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to