Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You use <code>PosixFilePermission</code> which can be used only with operating systems which are compatibile with POSIX:</p> <p><code>A file attribute view that provides a view of the file attributes commonly associated with files on file systems used by operating systems that implement the Portable Operating System Interface (POSIX) family of standards.</code></p> <p><code>Operating systems that implement the POSIX family of standards commonly use file systems that have a file owner, group-owner, and related access permissions. This file attribute view provides read and write access to these attributes</code></p> <p>Windows unfortunatelly doesn't support POSIX file systems so this is why your code doesn't work. In order to create a directory in Windows you should use:</p> <p><code>new File("/path/to/folder").mkdir();</code></p> <p>The <code>/</code> will be automatically changed to <code>\</code> in Windows. If you want to create the whole path at once you have to use <code>mkdirs()</code> method. More info: <a href="http://docs.oracle.com/javase/6/docs/api/java/io/File.html" rel="noreferrer">http://docs.oracle.com/javase/6/docs/api/java/io/File.html</a></p> <p>In order to set file permissions in Windows you have to use <code>setReadable()</code>, <code>setWritable()</code> and <code>setExecutable()</code>. That are <code>File</code> class methods and set only file owner's permissions. Note that mentioned methods were added in Java 1.6. In older versions you would have to use (Windows version):</p> <p><code>Runtime.getRuntime().exec("attrib -r myFile");</code></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.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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