chmod file mode by path via shell - Android Android OS

Android examples for Android OS:Shell

Description

chmod file mode by path via shell

Demo Code


//package com.java2s;

import java.io.IOException;

public class Main {
    public static void chmod(String permission, String path) {
        try {//from   ww w . j  a v a 2 s  .c o m
            String command = "chmod " + permission + " " + path;
            Runtime runtime = Runtime.getRuntime();
            runtime.exec(command);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related Tutorials