[Mono-bugs] [Bug 42706][Wis] New - File.Copy( ) and File Permissions

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Fri, 9 May 2003 16:35:23 -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 giuseppe.greco@agamura.com.

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

--- shadow/42706	Fri May  9 16:35:23 2003
+++ shadow/42706.tmp.21967	Fri May  9 16:35:23 2003
@@ -0,0 +1,47 @@
+Bug#: 42706
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 8.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: giuseppe.greco@agamura.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: File.Copy( ) and File Permissions
+
+To reproduce the problem, just write a small
+C# program like this:
+
+using System;
+using System.IO;
+
+class myCopy {
+
+  public static void Main() {
+
+    string source = Console.ReadLine();
+    string dest   = source + ".copy";
+    File.Copy(source, dest, true);
+    Console.WriteLine("File {0} copied to {1}", source, dest);
+  }
+}
+
+
+Then, use it to copy a file of your choice with permission 664:
+
+  mono myCopy.exe myFile
+
+Here's the result:
+
+-rw-rw-r--   1 genius genius ...  myFile
+-rw-------   1 genius genius ...  myFile.copy
+
+As you can see, the destination file (myFile.copy)
+has permission 600 instead of 664.