Java File Mod Change chmod(File file, String mode)

Here you can find the source of chmod(File file, String mode)

Description

chmod

License

Open Source License

Parameter

Parameter Description
file a parameter
mode a parameter

Exception

Parameter Description
IOException an exception

Declaration

public static void chmod(File file, String mode) throws IOException 

Method Source Code


//package com.java2s;
import java.io.*;

public class Main {
    /**//w  ww .  j  a v a2  s . co  m
     * @param file
     * @param mode
     * @throws IOException
     */
    public static void chmod(File file, String mode) throws IOException {
        Runtime.getRuntime().exec(new String[] { "chmod", mode, file.getAbsolutePath() });
    }
}

Related

  1. chmod(@Nonnull File file, int mode)
  2. Chmod(boolean recursive, String permission, String directoryFile)
  3. chmod(File file, int mode)
  4. chmod(final int mode, final File path)
  5. chmod(final String path, final String mode)
  6. chmod(String filename, String perm)
  7. chmodX(String filename)