[Mono-bugs] [Bug 359181] [PATCH] FileSystemWatcher: OldName and Name swapped on rename
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Feb 29 12:08:25 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=359181
User rkumpera at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=359181#c4
Rodrigo Kumpera <rkumpera at novell.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rkumpera at novell.com
--- Comment #4 from Rodrigo Kumpera <rkumpera at novell.com> 2008-02-29 10:08:25 MST ---
I'm not sure about this patch as we have another change that was due to the
rename event as well. Please take a look at r64950 as Juraj's patch is
basically reverting it.
2006-09-05 Gonzalo Paniagua Javier <gonzalo at ximian.com>
* InotifyWatcher.cs: fix file names for the rename event.
* FileSystemWatcher.cs: ignore exceptions that happen when invoking
event handlers.
Modified: trunk/mcs/class/System/System.IO/InotifyWatcher.cs
===================================================================
--- trunk/mcs/class/System/System.IO/InotifyWatcher.cs 2006-09-05 15:23:12 UTC
(rev 64949)
+++ trunk/mcs/class/System/System.IO/InotifyWatcher.cs 2006-09-05 15:38:06 UTC
(rev 64950)
@@ -498,9 +498,12 @@
} else {
nread += i;
action =
FileAction.RenamedNewName;
- renamed = new
RenamedEventArgs (WatcherChangeTypes.Renamed, data.Directory, evt.Name,
to.Name);
- filename = to.Name;
- evt = to;
+ if (evt.Name ==
data.Directory || fsw.Pattern.IsMatch (evt.Name)) {
+ renamed = new
RenamedEventArgs (WatcherChangeTypes.Renamed, data.Directory, to.Name,
evt.Name);
+ } else {
+ renamed = new
RenamedEventArgs (WatcherChangeTypes.Renamed, data.Directory, evt.Name,
to.Name);
+ filename =
to.Name;
+ }
}
} else if ((mask & InotifyMask.MovedTo)
!= 0) {
action = (new_name_needed) ?
FileAction.RenamedNewName : FileAction.Added;
--
Configure bugmail: https://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