[Mono-bugs] [Bug 322330] [Regression] FileSystemWatcher events have incorrect information

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 19 03:17:11 EDT 2009


User alexander at kojevnikov.com added comment

--- Comment #25 from Alexander Kojevnikov <alexander at kojevnikov.com>  2009-09-19 01:16:58 MDT ---
Created an attachment (id=318940)
 --> (http://bugzilla.novell.com/attachment.cgi?id=318940)
Proposed patch

This patch fixes the issues reported by the OP and in my previous comment. In

 * Hunks 1 and 4 remove the new_name_needed flag, it's not used anywhere and
only adds confusion.

 * Hunk 2 skips DeleteSelf event for sub-directories, they receive the Delete
event anyway.

 * Hunk 3 makes sure that we use a combination of Deleted+Created notifications
instead of a single Renamed notification, if the watched item has been moved
from one directory to another. This is because RenamedEventArgs supports only
one directory name: FullPath is always directory+name, OldFullPath is always

 * Hunk 5 updates relevant InotifyData instances with the new directory name.
Without this, notifications always use the original folder names.

The last hunk may be a bit slow as it needs to iterate on all the InotifyData
instances. On the other hand, we are already doing it on the Delete event
(lines 560:568) and by default inotify allows only 8192 watches per user.

On a side note, are there any regression tests for FileSystemWatcher, and if
there are, how to run them?

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list