如何从Java 1.4.2更改文件权限? [英] How to change file permissions from Java 1.4.2?

查看:138
本文介绍了如何从Java 1.4.2更改文件权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个代码片段,使用它我必须更改unix上的文件权限。我的项目运行在Java 1.4.2 ..

只是一个示例代码示例或方法,需要使用将做..



Regards,
Senny

解决方案您不是唯一一个:
如何更改文件的权限和上次修改Java?



原则上,如果现有的java.io.File方法不可用,则可以使用Runtime.exec(chmod ...够了。但它不会是便携式的。


I'm looking for a code fragment, using which I must be to change the file permissions on unix. My project runs on java 1.4.2 ..

just a sample code example or methods which needs to be used will do..

Regards, Senny

解决方案

You're not the only one: How to change the file's permission and last modified in Java?

You could, in principle, use Runtime.exec("chmod ...") if the existing java.io.File methods aren't enough. But it wouldn't be portable.

这篇关于如何从Java 1.4.2更改文件权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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