Android修改文件和文件夹权限
[java]
// 修改权限
public static void chmod(String permission, String path) {
try {
String command = "chmod " + permission + " " + path;
Runtime runtime = Runtime.getRuntime();
runtime.exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
// 修改权限
public static void chmod(String permission, String path) {
try {
String command = "chmod " + permission + " " + path;
Runtime runtime = Runtime.getRuntime();
runtime.exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}[java] view plaincopyprint?chmod("777", mContext.getFilesDir().toString());
chmod("777", mContext.getFilesDir().toString());
补充:移动开发 , Android ,