阅读背景:

在代码中给文件设置权限(代码中执行linux命令)

来源:互联网 


	private void Chmod() {
		try {
			File f = new File("/data" + "");
			File f1 = new File("/data" + "");
			Log.v("daming.zou***f**", "" + f.getAbsolutePath());
			Log.v("daming.zou***f1**", "" + f1.getAbsolutePath());
			if (f.exists()) {

				Runtime runtime = Runtime.getRuntime();
				Process proc = runtime.exec("chmod 777 " + f.getAbsolutePath()
						+ "/");
				boolean issuccess = proc.waitFor() == 0;
				Log.v("proc**file1**", "" + issuccess);
			} else if (f1.exists()) {
				Runtime runtime = Runtime.getRuntime();
				Process proc = runtime.exec("chmod 777 " + f1.getAbsolutePath()
						+ "/");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}	private void Chmod() {
		try {
			File f



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: