//创建文件
public void createTxt(){
File ct=new File(filetxt);
ct.setWritable(true, false);
ct.setReadable(true, false);
try {
Process process =null;
ct.createNewFile();
/获取LINUX权限的设置
String command1 = “chmod xxx “+ct.getAbsolutePath();
process = Runtime.getRuntime().exec(command1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println(“创建文件失败”);
}
}
linux创建文件的获取读写文件权限设置
最新推荐文章于 2023-03-17 14:49:56 发布