mail-archives/mono-bugs/2008-September/079759.html

262 строки
6.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 428270] New: FileSystemWatcher does not raise Changed() event on MacOSX Tiger 10.4
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20428270%5D%20New%3A%20FileSystemWatcher%20does%20not%20raise%0A%20Changed%28%29%20event%20on%20MacOSX%20Tiger%2010.4&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="079758.html">
<LINK REL="Next" HREF="079760.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 428270] New: FileSystemWatcher does not raise Changed() event on MacOSX Tiger 10.4</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20428270%5D%20New%3A%20FileSystemWatcher%20does%20not%20raise%0A%20Changed%28%29%20event%20on%20MacOSX%20Tiger%2010.4&In-Reply-To="
TITLE="[Mono-bugs] [Bug 428270] New: FileSystemWatcher does not raise Changed() event on MacOSX Tiger 10.4">bugzilla_noreply at novell.com
</A><BR>
<I>Mon Sep 22 04:18:52 EDT 2008</I>
<P><UL>
<LI>Previous message: <A HREF="079758.html">[Mono-bugs] [Bug 419079] UIA Support in StatusBar Control
</A></li>
<LI>Next message: <A HREF="079760.html">[Mono-bugs] [Bug 428270] FileSystemWatcher does not raise Changed() event on MacOSX Tiger 10.4
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#79759">[ date ]</a>
<a href="thread.html#79759">[ thread ]</a>
<a href="subject.html#79759">[ subject ]</a>
<a href="author.html#79759">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=428270">https://bugzilla.novell.com/show_bug.cgi?id=428270</A>
Summary: FileSystemWatcher does not raise Changed() event on
MacOSX Tiger 10.4
Product: Mono: Class Libraries
Version: 1.9
Platform: Macintosh
OS/Version: Mac OS X 10.4
Status: NEW
Severity: Normal
Priority: P5 - None
Component: System
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">miguel.debuf at aventiv.com</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: Community User
Installed mono 1.9.1 package on MacOSX 10.4.11 (macbook pro).
Code :
using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
FileSystemWatcher f = new FileSystemWatcher(args[0]);
f.IncludeSubdirectories = true;
f.InternalBufferSize = 5000000;
f.EnableRaisingEvents = true;
f.Created += new FileSystemEventHandler(f_Created);
f.Changed += new FileSystemEventHandler(f_Created);
f.Deleted += new FileSystemEventHandler(f_Created);
while (true)
{
f.WaitForChanged(WatcherChangeTypes.All);
}
}
static void f_Created(object sender, FileSystemEventArgs e)
{
Console.WriteLine(e.ChangeType + &quot; : &quot; + e.FullPath);
}
}
}
Test script :
#!/bin/bash
TESTDIR=/tmp/fswatcher.dir
function watch() {
install -d $1
(
mono fswatcher.exe $1 | while read LINE
do
echo &quot;[`date`] $LINE&quot;
done
) &amp;
}
function at() {
sleep $1
echo &quot;[`date`] $2&quot;
eval $2
}
watch $TESTDIR
at 1 &quot;touch $TESTDIR/bla.txt&quot;
at 1 &quot;echo a &gt;&gt; $TESTDIR/bla.txt&quot;
at 5 &quot;touch $TESTDIR/bla2.txt&quot;
sleep 1
killall mono
rm -rf $TESTDIR
Output :
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mdebuf at pc-192-168-2-232</A>:~/Projects/mono-fswatcher $ make test
bash test.sh
[Mon Sep 22 09:48:40 CEST 2008] touch /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:40 CEST 2008] Created : /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:41 CEST 2008] echo a &gt;&gt; /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:46 CEST 2008] touch /tmp/fswatcher.dir/bla2.txt
[Mon Sep 22 09:48:46 CEST 2008] Changed : /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:46 CEST 2008] Created : /tmp/fswatcher.dir/bla2.txt
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mdebuf at pc-192-168-2-232</A>:~/Projects/mono-fswatcher $
Expected result : the changed() event for 'echo a &gt;&gt; ...' should have fired
after the call, not after the creation of a second file. In other words, the
output should look like :
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mdebuf at pc-192-168-2-232</A>:~/Projects/mono-fswatcher $ make test
bash test.sh
[Mon Sep 22 09:48:40 CEST 2008] touch /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:40 CEST 2008] Created : /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:41 CEST 2008] echo a &gt;&gt; /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:41 CEST 2008] Changed : /tmp/fswatcher.dir/bla.txt
[Mon Sep 22 09:48:46 CEST 2008] touch /tmp/fswatcher.dir/bla2.txt
[Mon Sep 22 09:48:46 CEST 2008] Created : /tmp/fswatcher.dir/bla2.txt
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mdebuf at pc-192-168-2-232</A>:~/Projects/mono-fswatcher $
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="079758.html">[Mono-bugs] [Bug 419079] UIA Support in StatusBar Control
</A></li>
<LI>Next message: <A HREF="079760.html">[Mono-bugs] [Bug 428270] FileSystemWatcher does not raise Changed() event on MacOSX Tiger 10.4
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#79759">[ date ]</a>
<a href="thread.html#79759">[ thread ]</a>
<a href="subject.html#79759">[ subject ]</a>
<a href="author.html#79759">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>