[Mono-bugs] [Bug 74640][Nor] New - FileInfo.Length fails depending upon file name.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 16 Apr 2005 22:17:59 -0400 (EDT)


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 jrodman@ximian-bugzilla.spamportal.net.

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

--- shadow/74640	2005-04-16 22:17:59.000000000 -0400
+++ shadow/74640.tmp.26587	2005-04-16 22:17:59.000000000 -0400
@@ -0,0 +1,37 @@
+Bug#: 74640
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: SuSE Linux Enterprise Server 9.x
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: io-layer
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jrodman@ximian-bugzilla.spamportal.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FileInfo.Length fails depending upon file name.
+
+The following code will never work:
+
+using System.IO;
+using System;
+
+class TrailingSpace {
+  public static void Main() {
+     FileInfo fi = new FileInfo("trailingspace ");
+     Console.WriteLine("The length of the file is {0}",fi.Length);
+  }
+}
+
+for some reason the bowels of FileInfo actually remove the space from the
+string, attempt to access "trailingspace" without the space, and thus throw
+an exception even if the named file is present.  I think it is clear this
+should not occur.
+
+An strace shows mono calling stat() with the correct path, followed by the
+incorrect path.