diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-14 02:31:34 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-14 02:31:34 +0400 |
commit | 6457cfba7c99205f5d0d3926d5f2581e3db756ac (patch) | |
tree | fe03212ebaa8d7191e1ff68ad97b568a9674ee95 /mcs/class/System | |
parent | 35087f63d516c65ac76a22539629044142372b85 (diff) |
2009-07-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
* InotifyWatcher.cs: when a watched subdirectory is deleted, remove it
from the list of children and only raise an event if it matches the
filter.
svn path=/trunk/mcs/; revision=137829
Diffstat (limited to 'mcs/class/System')
-rw-r--r-- | mcs/class/System/System.IO/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System/System.IO/InotifyWatcher.cs | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mcs/class/System/System.IO/ChangeLog b/mcs/class/System/System.IO/ChangeLog index e42bbdf55e8..a39efba59b4 100644 --- a/mcs/class/System/System.IO/ChangeLog +++ b/mcs/class/System/System.IO/ChangeLog @@ -1,3 +1,9 @@ +2009-07-13 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * InotifyWatcher.cs: when a watched subdirectory is deleted, remove it + from the list of children and only raise an event if it matches the + filter. + 2009-06-04 Marek Habersack <mhabersack@novell.com> * InotifyWatcher.cs: filter pattern should be matched on file name diff --git a/mcs/class/System/System.IO/InotifyWatcher.cs b/mcs/class/System/System.IO/InotifyWatcher.cs index f58cc43e522..e1ef7613d4c 100644 --- a/mcs/class/System/System.IO/InotifyWatcher.cs +++ b/mcs/class/System/System.IO/InotifyWatcher.cs @@ -547,6 +547,16 @@ namespace System.IO { } } + if (action == FileAction.Removed && filename == data.Directory) { + int idx = parent.children.IndexOf (data); + if (idx != -1) { + parent.children.RemoveAt (idx); + if (!fsw.Pattern.IsMatch (Path.GetFileName (filename))) { + continue; + } + } + } + if (filename != data.Directory && !fsw.Pattern.IsMatch (Path.GetFileName (filename))) { continue; } |