【发布时间】:2013-02-23 07:04:21
【问题描述】:
我是否以错误的方式使用deleteOnExit?
我创建一个目录然后运行:
new File("my_dir_path").deleteOnExit();
尽管 JDK 文档说 Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates.
【问题讨论】:
-
那个 my_dir_path 是非空的吗?
-
谢谢,我猜是这样。
-
要有效地
deleteOnExit一个目录尝试shutdown hook
标签: java