作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
谁能告诉我 Paths.get("")
指向哪里?
这是代码和输出。
public static void main(String[] args) {
Path path = Paths.get("");
System.out.printf("`%s`%n", path);
System.out.printf("`%s`%n", path.normalize());
System.out.println(Files.exists(path));
System.out.println(Files.isExecutable(path));
}
``
``
true
true
最佳答案
System.out.println(Paths.get("").toAbsolutePath());
/Users/andrew/workspace/scratch
看起来是当前工作目录。在我的机器上,Java 报告它是可执行的,因为目录上的“x”标志对当前用户而言是正确的。
来自javadocs :
This method checks that a file exists and that this Java virtual machine has appropriate privileges to execute the file. The semantics may differ when checking access to a directory. For example, on UNIX systems, checking for execute access checks that the Java virtual machine has permission to search the directory in order to access file or subdirectories.
关于Java 尼奥。空路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40368471/
所以我在 jQuery 可排序方面遇到了奇怪的问题。我有可排序的 li 元素,排序很好,但是在 IE 中,拖动时图像会消失。我相当确定它们的位置很奇怪,但在任何其他浏览器中似乎都不会发生这种情况,其他
我是一名优秀的程序员,十分优秀!