[Mono-dev] FileSystemWatcher on Windows (compared to .NET4)

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Wed Feb 9 17:44:51 EST 2011


On Mon, 2011-02-07 at 14:28 -0800, kpfaulkner wrote:
> Hi
> 
> I've noticed that the results for "renamed" and "delete" events on mono
> (2.8.2) and "native" .NET 4 are different.
> 
> If I rename a directory for example I get:
> 
>  - mono  I get a bunch of delete and create's...  which is fairly useful.
>  - .NET 4 I get a simple "renamed" event for the parent directory. No
> information about the contents.
> 
> Although I find monos results far more useful (means I dont have to code up
> the subdir listing to get filenames myself) I'm thinking that
> compatibility/consistency with "real" .NET is more important.
> 
> Could someone tell me if this is an intentional difference, or whether this
> is simply a bug that I need to register.

On Windows, Mono uses the default backend for monitoring files, which
does not use any OS APIs. That backend has no way of knowing the
difference between a rename and a delete|create.

On linux, we use inotify and the events will defer (you can make Mono
the default backend if that's what you want. Check out the mono(1)
manual page).

-Gonzalo




More information about the Mono-devel-list mailing list