[Mono-bugs] [Bug 322330] [Regression] FileSystemWatcher events have incorrect information

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jun 23 14:39:23 EDT 2008


User gert.driesen at pandora.be added comment

Gert Driesen <gert.driesen at pandora.be> changed:

           What    |Removed                                         |Added
                 CC|                                                |gert.driesen at pandora.be

--- Comment #5 from Gert Driesen <gert.driesen at pandora.be>  2008-06-23 12:39:22 MDT ---
The original issue also does not appear to be fixed.

To reproduce, compile and run the following code:

using System;
using System.IO;
using System.Threading;

class Program
        static void Main (string [] args)
                string base_dir = AppDomain.CurrentDomain.BaseDirectory;
                string watch_dir = Path.Combine (base_dir, "watch");

                if (Directory.Exists (watch_dir))
                        Directory.Delete (watch_dir, true);
                Directory.CreateDirectory (watch_dir);

                FileSystemWatcher watcher = new FileSystemWatcher ();
                watcher.Path = watch_dir;
                watcher.Created += new FileSystemEventHandler (Created);

                File.Create (Path.Combine (watch_dir, "helloWorld")).Close ();
                Thread.Sleep (200);

                watcher.IncludeSubdirectories = true;
                watcher.EnableRaisingEvents = true;

                string foo_dir = Path.Combine (watch_dir, "foo");
                string bar_dir = Path.Combine (watch_dir, "bar");

                Directory.CreateDirectory (foo_dir);

                Thread.Sleep (200);

                Directory.Move (foo_dir, bar_dir);

                Thread.Sleep (200);

                File.Create (Path.Combine (bar_dir, "hiWorld")).Close ();

                Thread.Sleep (2000);

        static void Created (object sender, FileSystemEventArgs args)
                Console.WriteLine ("Created: " + args.FullPath);

Expected result:

Created: .../watch/foo
Created: .../watch/bar/hiWorld

Actual result:

Created: .../watch/foo
Created: .../watch/foo/hiWorld

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list