[Mono-bugs] [Bug 82440][Maj] Changed - [Regression] IOException in Directory.GetFileSystemEntries

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 7 18:05:00 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by juraj at hotfeet.ch.

http://bugzilla.ximian.com/show_bug.cgi?id=82440

--- shadow/82440	2007-09-04 14:15:14.000000000 -0400
+++ shadow/82440.tmp.32196	2007-09-07 18:05:00.000000000 -0400
@@ -60,6 +60,53 @@
 BTW: I tried constructing a small test case, but didn't succeed...
 
 ------- Additional Comments From juraj at hotfeet.ch  2007-09-04 14:15 -------
 I'm also seeing this message occasionally in apache's error_log:
 
 ** Message: Unknown errno: Inappropriate ioctl for device
+
+------- Additional Comments From juraj at hotfeet.ch  2007-09-07 18:04 -------
+Here comes a trivial test case:
+
+- create "test.cs" containing:
+======
+using System;
+using System.IO;
+
+class Test {
+ static void Main() {
+  Console.WriteLine(Directory.GetFiles(".", "test*").Length);
+  Console.WriteLine(Directory.GetFiles(".", "test*.*").Length);
+ }
+}
+========
+- compile it
+- run it (in the same directory)
+
+Actual output (assuming you only got "test.cs" and "test.exe" in this
+dir):
+2
+0
+
+Expected output:
+2
+2
+
+
+Remove the "*." special case code (see below) from io-portability and
+you get the expected output.
+
+if (g_str_has_suffix (pattern, ".*")) {
+ /* Special-case the patterns ending in '.*', as
+ * windows also matches entries with no extension with
+ * this pattern.
+ * 
+ * TODO: should this be a MONO_IOMAP option?
+ */
+ gchar *pattern2 = g_strndup (pattern, strlen (pattern) - 2);
+
+ g_dir_rewind (dir);
+ result = _wapi_glob (dir, pattern2, flags | WAPI_GLOB_APPEND |
+WAPI_GLOB_UNIQUE, &glob_buf);
+
+ g_free (pattern2);
+}


More information about the mono-bugs mailing list