我们有一个 linux 应用程序,由于以下调用,我们无法卸载 USB 驱动器。我需要正确关闭流的文件资源吗?
Files.newDirectoryStream(
Paths.get(importDir),
path -> path.toString().endsWith(".ini") && path.toFile().isFile())
.forEach(path -> importItems.add(path));
这是响应的输出:
umount: /media/flashdrive: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
我们目前使用的是 java 8。