Author: mturk
Date: Thu Aug  6 08:39:10 2009
New Revision: 801538

URL: http://svn.apache.org/viewvc?rev=801538&view=rev
Log:
Print default umask and perms

Modified:
    commons/sandbox/runtime/trunk/src/main/native/test/testcase.c
    
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java

Modified: commons/sandbox/runtime/trunk/src/main/native/test/testcase.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testcase.c?rev=801538&r1=801537&r2=801538&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testcase.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testcase.c Thu Aug  6 
08:39:10 2009
@@ -37,6 +37,11 @@
 #define srandom srand
 #endif
 
+#if !defined(WIN32)
+extern mode_t acr_default_umask;
+extern mode_t acr_default_perms;
+#endif
+
 /**
  * Test cases
  */
@@ -573,6 +578,12 @@
 
 ACR_JNI_EXPORT_DECLARE(jint, TestFile, ftest00)(ACR_JNISTDARGS, jint d)
 {
+#if !defined(WIN32)
+    fprintf(stderr, "Default umask %04o\n", acr_default_umask);
+    fprintf(stderr, "Default perms %04o\n", acr_default_perms);
+    fflush(stdout);
+#endif
+
     return ldfile(_E);
 }
 

Modified: 
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java?rev=801538&r1=801537&r2=801538&view=diff
==============================================================================
--- 
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java 
(original)
+++ 
commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java 
Thu Aug  6 08:39:10 2009
@@ -243,6 +243,8 @@
         EnumSet <FileProtection> fp = f.getFileProtection();
         System.out.println();
         System.out.println("Org Rdonly Protection " + fp);
+        // Make sure we have GWRITE regardless of default umask
+        f.setFileProtection(EnumSet.of(FileProtection.GWRITE));
         // Set the rdonly attributes
         f.setFileAttributes(EnumSet.of(FileAttributes.READONLY), 
EnumSet.allOf(FileAttributes.class));
         // Clear the rdonly attributes


Reply via email to