Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could also look at the Gnu ClassPath implementation of <a href="http://cvs.savannah.gnu.org/viewvc/classpath/java/io/File.java?revision=1.70&amp;root=classpath&amp;view=markup" rel="nofollow noreferrer">java.lang.File</a></p> <p>They implemented the function based on JNI calls:</p> <pre><code>native/jni/java-io/java_io_VMFile.c: set_file_permissions: new helper function. Java_java_io_VMFile_setReadable: new native method to bakcup 1.6 methods in VMFile.java. </code></pre> <p><a href="http://cvs.savannah.gnu.org/viewvc/classpath/vm/reference/java/io/VMFile.java?revision=1.13&amp;root=classpath&amp;view=markup" rel="nofollow noreferrer">VMFile.java</a> declares the call:</p> <pre><code> /** * Set the write permission of the file. */ public static synchronized native boolean setWritable(String path, boolean writable, boolean ownerOnly); </code></pre> <p><a href="http://cvs.savannah.gnu.org/viewvc/classpath/native/jni/java-io/java_io_VMFile.c?revision=1.17&amp;root=classpath&amp;view=markup" rel="nofollow noreferrer">native/jni/java-io/java_io_VMFile.c</a> does implement the desired function...</p> <pre><code>JNIEXPORT jboolean JNICALL Java_java_io_VMFile_setWritable (JNIEnv *env, jclass clazz __attribute__ ((__unused__)), jstring name, jboolean writable, jboolean ownerOnly) { return set_file_permissions (env, name, writable, ownerOnly, CPFILE_FLAG_WRITE); } [...] result = cpio_chmod (filename, permissions); </code></pre> <p>So... if you really want it, it is possible to implement it, by looking at the <a href="http://acapulco.dyndns.org/manual/src/work/gcc-4.3.0/libjava/classpath/native/jni/native-lib/cpio.c" rel="nofollow noreferrer">source of cpio.c</a>: it calls <code>chmod</code> from <strong>libc</strong> standard library (<a href="http://gnuwin32.sourceforge.net/packages/libgw32c.htm" rel="nofollow noreferrer">LibGW32C</a> does port some of those functions to Windows)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload