Files.isHidden(Path.of("c:\\"))
在 Windows 10、JDK 13 上返回 true
但在 JDK 12 同一台机器上返回 false。
谁知道这是为什么?
最佳答案
这是一个bug JDK 13 修复了这个问题。
On Microsoft Windows, the java.nio.file.Files.isHidden method has historically ignored the DOS "hidden" attribute on directories. This has been fixed in this release so that isHidden now returns true when invoked to test a directory that has this attribute set.
关于java - Files.isHidden C :\\changed between JDK12 and JDK13 on windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58169000/