如何更改文件的权限和上次在Java中修改? [英] How to change the file's permission and last modified in Java?
本文介绍了如何更改文件的权限和上次在Java中修改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
我在看 Java 6文档,还有一个 setLastModified()
方法,以及 setReadable(...)
和 setWritable(...)
和 setExecutable(...)
方法(全部在 java.io.File
类中)。所以是的,有一种方法...
To my knowledge, Java's File class does not support to change the file's permission and last modified date. Is there any proper way to do this in a cross-platform style?
解决方案
I'm looking at the Java 6 documentation, and there is a setLastModified()
method, as well as setReadable(...)
and setWritable(...)
and setExecutable(...)
methods (all in the java.io.File
class). So yes, there is a way...
这篇关于如何更改文件的权限和上次在Java中修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文