// 获取操作系统
String os = System.getProperty("os.name");
//转换小写后判断3位字符前缀
if(!os.toLowerCase().startsWith("win")){
try {
//开放权限
Runtime.getRuntime().exec("chmod 777 -R " + "/usr/local/yqy.jpg");
}catch (IOException e){
e.printStackTrace();
}
}
java在linux系统下放开文件权限
最新推荐文章于 2022-07-01 10:43:40 发布