我這里包含文件夾的文件不能一步創建完
File file3 =new File("E:\\hello.text\\a.text");
這一句要分成兩步才能創建出來,而且不是文件,而是一個文件夾。
第一步File file3 =new File("E:\\hello.text");
有了hello.text
File file3 =new File("E:\\hello.text\\a.text");
File file3 =new File("E:\\hello.text\\a.text");
這一句要分成兩步才能創建出來,而且不是文件,而是一個文件夾。
第一步File file3 =new File("E:\\hello.text");
有了hello.text
File file3 =new File("E:\\hello.text\\a.text");
2016-06-23
舉報
2016-10-30
File file=new File("D:\\hello.text\\a.text");
if (!file.exists()) {
file.mkdirs();
}
System.out.println("over");
可以一次創建 !如果沒創建成功,看看 盤符 等其他問題!
2016-10-30
好像你的 file.mkdir 少個s吧
2016-06-23
有了hello.text文件夾之后才能創建出來文件夾里面的文件夾。
真是奇怪。
而且\\改為. 之后報錯。