2004-12-02 Geoff Norton <gnorton@customerdna.com>
authorGeoff Norton <grompf@sublimeintervention.com>
Thu, 2 Dec 2004 22:19:49 +0000 (22:19 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Thu, 2 Dec 2004 22:19:49 +0000 (22:19 -0000)
        * System.IO/KeventWatcher.cs: Add IDisposable to our kevent struct
        so the disposer gets called.  Fixes a small memory leak.  Dont monitor
        LastAccessedTime for changed files, as this will cause AppUnloading in XSP
        when global.asax is accessed after creation.  Use a case-insensitive IsMatch        to deal with OSX Case-aware/Case-insensitive filesystem.
        * System.IO/SearchPattern.cs: Add a overload to IsMatch to explicitly set
        the ignore field for OSX case-aware yet case-insensitive filesystem.  This
        allows monitoring of global.asax to happen properly.

svn path=/trunk/mcs/; revision=36977

mcs/class/System/ChangeLog
mcs/class/System/System.IO/KeventWatcher.cs
mcs/class/System/System.IO/SearchPattern.cs

index aa1060472fba99f109e71bd1700602b52fe2c8de..a9443a73ea61d25f369e315abe61b68ed168bb9f 100644 (file)
@@ -1,3 +1,14 @@
+2004-12-02  Geoff Norton  <gnorton@customerdna.com>
+
+       * System.IO/KeventWatcher.cs: Add IDisposable to our kevent struct
+       so the disposer gets called.  Fixes a small memory leak.  Dont monitor
+       LastAccessedTime for changed files, as this will cause AppUnloading in XSP
+       when global.asax is accessed after creation.  Use a case-insensitive IsMatch
+       to deal with OSX Case-aware/Case-insensitive filesystem.
+       * System.IO/SearchPattern.cs: Add a overload to IsMatch to explicitly set
+       the ignore field for OSX case-aware yet case-insensitive filesystem.  This
+       allows monitoring of global.asax to happen properly.
+
 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * System_test.dll.sources: added CookieContainerTest.cs.
index e1e6ba03d9f9dbb86b3b8fc3489ecb1795645e36..6adff10b16c8c25944415062b9241998544470d1 100644 (file)
@@ -37,7 +37,7 @@ using System.Threading;
 
 namespace System.IO {
 
-       struct kevent {
+       struct kevent : IDisposable {
                public int ident;
                public short filter;
                public ushort flags;
@@ -259,7 +259,7 @@ namespace System.IO {
                                        foreach (FileSystemInfo fsi in dir.GetFileSystemInfos() )
                                                if (data.DirEntries.ContainsKey (fsi.FullName) && (fsi is FileInfo)) {
                                                        KeventFileData entry = (KeventFileData) data.DirEntries [fsi.FullName];
-                                                       if ( (entry.LastWriteTime != fsi.LastWriteTime) || (entry.LastAccessTime != fsi.LastAccessTime) ) {
+                                                       if (entry.LastWriteTime != fsi.LastWriteTime) {
                                                                filename = fsi.Name;
                                                                fa = FileAction.Modified;
                                                                data.DirEntries [fsi.FullName] = new KeventFileData(fsi, fsi.LastAccessTime, fsi.LastWriteTime);
@@ -330,7 +330,7 @@ namespace System.IO {
                                }
                        }
                
-                       if (!fsw.Pattern.IsMatch(filename))
+                       if (!fsw.Pattern.IsMatch(filename, true))
                                return;
 
                        lock (fsw) {
index 2c78c3816a95d53da288cb7ca3dbd6c7877951f0..a74ee92d4a890e994a2e95fdb68fbf41b929232f 100644 (file)
@@ -47,6 +47,14 @@ namespace System.IO {
                        Compile (pattern);
                }
 
+               // OSX has a retarded case-insensitive yet case-aware filesystem
+               // so we need a overload in here for the Kqueue watcher
+               public bool IsMatch (string text, bool ignore)
+               {
+                       this.ignore = ignore;
+                       return IsMatch (text);
+               }
+
                public bool IsMatch (string text)
                {
                        if (!hasWildcard)