通过阅读this教程,我遇到过这部分我不太清楚。
Empty directories can be moved. If the directory is not empty, the move is allowed when the directory can be moved without moving the contents of that directory.
我显然彻底明白了,空目录是可以 move 的。然而,引用的第二部分在我看来有点令人困惑。任何人都可以用换句话说来表达相同的概念吗?提前致谢。
最佳答案
On UNIX systems, moving a directory within the same partition generally consists of renaming the directory. In that situation, this method works even when the directory contains files.
这实际上是您发布的链接中的下一句,它提供了一个示例,说明即使目录不为空也可以使用 move 。
关于java - Java 中的 Files.move(Path, Path),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16341342/