android java调用命令行给文件赋权限

public void chmodFiles(){
Process p = null;
		try {
			p = Runtime.getRuntime().exec("chmod 777 productinfo");
    		file.createNewFile();
			Runtime.getRuntime().exec("chmod 777 "+file.getAbsolutePath());
            int status = p.waitFor();
		} catch (IOException e) {
		    // TODO Auto-generated catch block
		    e.printStackTrace();
		} catch (InterruptedException e) {
                // TODO Auto-generated catch block
            e.printStackTrace();
        }
}

猜你喜欢

转载自ericchan2012.iteye.com/blog/1687591