[Mono-bugs] [Bug 82141][Cos] New - File.Move throws UnauthorizedAccessExc. with empty path

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 19 11:35:21 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=82141

--- shadow/82141	2007-07-19 11:35:21.000000000 -0400
+++ shadow/82141.tmp.31541	2007-07-19 11:35:21.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 82141
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: FC6
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: juraj at hotfeet.ch               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: File.Move throws UnauthorizedAccessExc. with empty path
+
+When trying to move a file using File.Move to or from a directory we don't
+have write access to, an UnauthorizedAccessException is thrown (so far so
+good), but the exceptions message is always 'Access to the path "" is denied.'
+
+Test case:
+==========
+
+using System;
+using System.IO;
+
+class Move {
+	public static void Main(string[] args) {
+		try {
+			File.Move(args[0], args[1]);
+		} catch(Exception e) {
+			Console.WriteLine(e);
+		}
+	}
+}
+
+Results:
+========
+
+[js at leonardo mono]$ mono move.exe /usr/bin/vim /tmp/vim
+System.UnauthorizedAccessException: Access to the path "" is denied.
+  at System.IO.File.Move (System.String src, System.String dest) [0x00000] 
+  at Move.Main (System.String[] args) [0x00000]
+
+
+[js at leonardo mono]$ mono move.exe /tmp/test.txt /usr/bin/test.txt
+System.UnauthorizedAccessException: Access to the path "" is denied.
+  at System.IO.File.Move (System.String src, System.String dest) [0x00000] 
+  at Move.Main (System.String[] args) [0x00000]


More information about the mono-bugs mailing list