无法创建新文件:设备未准备好 [英] Cannot Create New file: The device is not ready

查看:172
本文介绍了无法创建新文件:设备未准备好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 线程main中的异常java.io .IOException:设备没有准备好。
在java.io.WinNTFileSystem.createFileExclusively(Native方法)$ b $在java.io.File.createNewFile(File.java:947)
在pdfconverter。 PdfConverter.main(PdfConverter.java:96)

Java结果:1



在我的第96行是这样的条件:

$ $ p $ if(!logfile.exists()){
logfile.createNewFile(); //第96行
}

之前使用这个amny时间,我不明白发生了什么因为我以管理员身份登录。请帮助。

解决方案

问题在于Path找不到,因为有人将驱动器号从F重命名为D.对不起,不及时注意。


I am Creating a new File using Java but am getting tis exception:

Exception in thread "main" java.io.IOException: The device is not ready
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:947)
at pdfconverter.PdfConverter.main(PdfConverter.java:96)

Java Result: 1

In My line 96 is this Condition:

if (!logfile.exists()) {
        logfile.createNewFile();//line 96
    }

I have used this amny times before and I do not understand what's going on Because I am logged in as Administrator. Please Help.

解决方案

The problem was the Path, which was not found because someone had renamed the drive letter from F to D. Sorry for not noticing that In time.

这篇关于无法创建新文件:设备未准备好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆