https://bugzilla.novell.com/show_bug.cgi?id=346123
Summary: [Linux] File and directory names with backslashes are
trimmed
Product: Mono: Runtime
Version: 1.2.6
Platform: All
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: io-layer
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [EMAIL PROTECTED]
Found By: ---
Apparently, Directory.GetFiles and Directory.GetDirectories strips the part of
the file or directory name before the backslash.
To reproduce, compile and run the following code:
using System;
using System.IO;
class Program
{
static void Main ()
{
string root = Path.Combine (AppDomain.CurrentDomain.BaseDirectory,
"test");
if (Directory.Exists (root))
Directory.Delete (root, true);
Directory.CreateDirectory (root);
string file = Path.Combine (root, @"doc\temp1.file");
File.Create (file).Close ();
string [] files = Directory.GetFiles (root);
Console.WriteLine ("A1: " + (files.Length == 1));
Console.WriteLine ("A2: " + files [0]);
string dir = Path.Combine (root, @"sub\dir");
Directory.CreateDirectory (dir);
string [] dirs = Directory.GetDirectories (root);
Console.WriteLine ("B1: " + (dirs.Length == 1));
Console.WriteLine ("B2: " + dirs [0]);
}
}
Expected result:
A1: True
A2: .../test/doc\temp1.file
B1: True
B2: .../test/sub\dir
Actual result:
Expected result:
A1: True
A2: .../test/temp1.file
B1: True
B2: .../test/dir
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs