如何使用Java代码将图像权限模式更改为777? [英] How to change image permission mode to 777 using Java code?

查看:266
本文介绍了如何使用Java代码将图像权限模式更改为777?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java代码将权限模式值777赋予映像文件。我怎样才能用Java来表达呢?因为我无法使用默认权限模式664删除图像。

I want to give permissions mode value "777" to image file using Java code. How can I give that using Java? Because I can't delete the image with default permission mode "664".

推荐答案

您可以使用'exec'方法运行外部命令来执行chmod。

You can use the 'exec' method to run an external command to do the chmod.

Runtime.getRuntime().exec( "chmod 777 myfile" );

这篇关于如何使用Java代码将图像权限模式更改为777?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆