[Mono-bugs] [Bug 82514][Min] New - [Linux] FileAttributes.Archive no longer has any effect

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 21 06:36:26 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 gert.driesen at pandora.be.

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

--- shadow/82514	2007-08-21 06:36:26.000000000 -0400
+++ shadow/82514.tmp.24362	2007-08-21 06:36:26.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 82514
+Product: Mono: Runtime
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: io-layer
+AssignedTo: dick at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [Linux] FileAttributes.Archive no longer has any effect
+
+Setting FileAttributes.Archive for a file no longer has any effect on 
+Linux.
+
+This worked before, but has been broken for quite a while now (causing a 
+NAnt unit test failure on Linux).
+
+To reproduce, compile and run the following code snippet on Linux:
+
+using System;
+using System.IO;
+
+class Program
+{
+  static int Main ()
+  {
+    string tempFile = Path.Combine (AppDomain.CurrentDomain.BaseDirectory,
+                                    "file.tmp");
+    if (!File.Exists (tempFile)) {
+      using (FileStream fs = File.Create (tempFile)) {
+      }
+    }
+
+    try {
+      File.SetAttributes (tempFile, FileAttributes.Archive |
+                          FileAttributes.ReadOnly);
+      if ((File.GetAttributes (tempFile) & FileAttributes.Archive) == 0) {
+        Console.WriteLine ("#1");
+        return 1;
+      }
+      return 0;
+    } finally {
+      File.SetAttributes (tempFile, FileAttributes.Normal);
+      File.Delete (tempFile);
+    }
+  }
+}


More information about the mono-bugs mailing list