FileSystemWatcher.cs: Fixed multicast events.
SearchPattern.cs : Fixed issue where case insensitivity was not being honored.
KeventWatcher.cs:
* Fixed several race conditions
* Fixed file descriptor duplication & leaks
* thread-safe/cleaner state transitions for watcher, and much cleaner stopping
* Now uses fsw.Filter parameter and respects IncludeSubdirectories = false. Use fsw.Filter to watch very large trees
* Added more error handling + OnError event
* Lots of behavior/reliability fixes and optimizations for Monitor() loop
* Fixed kevent/timespec struct definitions (for 64-bit build)
Reworked a lot of the internals of the kqueue FileSystemWatcher. There
is now a separate thread and a separate kqueue for each FileSystemWatcher
object.
https://bugzilla.xamarin.com/show_bug.cgi?id=16259
This merely introduces a more readable version of some of the constants that
were hardcoded on the source code.
There is a suspect value "20" that was on the original source code, that
stands for VNodeLink and VNodeExtend, but perhaps the original author
meant to say VNodeRename. In any case, it seems like we should catch all
of them (except for Revoke).
My first fix for Bug 5747 was reverted because it broke something with
file system monitoring in XSP.
This is a revision of that same patch, but this time i take into account
the possibility that the fsw.FullPath value could possibly end with "/".
The previous version of this commit, no longer in place, didn't factor
that in and as a result if the fullpath ended in "/" we would cut the first
character off filename by virtue of the "Length + 1" substring.
The purpose of this patch was to fix the following problem:
files/directories modified in subdirectories were coming back with
just the file NAME and not subdirectory path. This patch modifies
the filename so if you get an alert on a file in a subdirectory 'mysubdir/file1'
you would get 'mysubdir/file1' rather than just 'file1', for whatever
direcotry (fullpath) you are watching..
Please note, i tried but i can't get XSP from git to use my local development
version of mono -- as a result i couldn't test against XSP. Instead, i tested
against the bug report source sample both with and without a trailing '/'
separator. Prior to this revised version, if full pathname ended in a trailing
'/', and you modified 'file1' you would get back 'ile1' a as the filename if
the prior patch was applied.
Someone may want to test against xsp before accepting this revised submission
Attached extracts the subdirectory by taking a substring of the full
filename path, starting at the length of the watcher filename path
(presuming it matches) plus 1 (to account for the "/" between path and
either subdir or filename).
This only should affect Mac OS -- See this line at top of KeventWatcher.cs:
// System.IO.KeventWatcher.cs: interface with osx kevent
Note the "osx" which is the mac operating system.
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
This is a scripted conversion of mixed line-ending files to LF-only or CRLF-only
based on which patch is smaller. I used a threshold of upto a quarter of the
lines to determine whether to keep the patch or not.
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.
With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
* DefaultWatcher.cs: patch by James P. Mitchel III.
The change corrects an instance of unsynchronized access to shared
state and is probably the intent of the original code.
svn path=/trunk/mcs/; revision=146290
* InotifyWatcher.cs: optimized the Renamed event child update loop
in the previous commit for directories in ProcessEvents.
svn path=/trunk/mcs/; revision=142984
* InotifyWatcher.cs: fixes bug #322330. Patch by Alexander Kojevnikov.
This patch fixes the issues reported by the OP and in my previous
comment. In particular:
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 directory+old_name.
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.
svn path=/trunk/mcs/; revision=142958
* 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
* HttpApplicationFactory.cs: OnFileChanged ignores the directory
part of the file triggering the event. Fixes bug #509998
2009-06-04 Marek Habersack <[email protected]>
* InotifyWatcher.cs: filter pattern should be matched on file name
alone, not on the relative path of the file triggering the
event. Fixes bug #509998
svn path=/trunk/mcs/; revision=135460
* InotifyWatcher.cs: don't send events when a directory is created
unless it matches the pattern. Fixes bug #484082.
svn path=/trunk/mcs/; revision=129112
* SearchPattern.cs: make IsMatch work for situations when there is
no wildcard in the pattern, but a subdirectory match is being
tested, e.g. pattern == "file.txt" and text ==
"subdir/file.txt". Lack of support for this has been causing
watching for changes to ASP.NET's web.config in subdirectories to
fail.
svn path=/trunk/mcs/; revision=124491
* InotifyWatcher.cs: IN_CLOSE_WRITE is triggered when a writable file is
closed, but that does not mean that the file was actually modified.
Fixes bug #323188.
svn path=/trunk/mcs/; revision=114646
* InotifyWatcher.cs: If a directory is renamed, make sure the old
version is removed from the requests hash. Fixes bug 322330.
svn path=/trunk/mcs/; revision=106302
* FileSystemWatcher.cs: added support for NullFileWatcher. Fixes
bug #354701
* NullFileWatcher.cs: added an IFileWatcher implementation which
does nothing. Selected only by setting the MONO_MANAGED_WATCHER
environment variable to 'disabled'. Fixes bug #354701
svn path=/trunk/mcs/; revision=100953
2007-10-30 Robert Jordan <[email protected]>
* ProcessTest.cs: Add tests for bug #319829.
In System.Diagnostics:
2007-10-30 Robert Jordan <[email protected]>
* Process.cs: Wrap the redirected streams with a stream
that provides real async Begin/Read|Write operations.
Fixes bug #319829.
In System.IO:
2007-10-30 Robert Jordan <[email protected]>
* MonoSyncFileStream.cs: Add.
svn path=/trunk/mcs/; revision=88491
* FileSystemWatcher.ch (RaiseEvent): Invoke delegate directly, we don't
need the extra control provided by using GetInvocationList().
svn path=/trunk/mcs/; revision=82295
* InotifyWatcher.cs: workaround for a weird case. Someone is watching
/dev with recursion enabled and the inotify file descriptor shows up
as a directory that fails to open. Already reported to Robert Love.
svn path=/trunk/mcs/; revision=66273