`

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();
        }
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics