mkdir() is not creating the new directory

后端 未结 7 2210
庸人自扰
庸人自扰 2020-12-18 20:59

I am using Eclipse and jdk1.7. I am making a basic program using file handling, in which an output directory inside the directory is to be made. But when I run the program,

7条回答
  •  再見小時候
    2020-12-18 21:28

    calling the only file.mkdirs() often doesn't work. call it in an evaluation such as -

    if(file.mkdirs()){ //do something}
    

    Or, in an assignment such as -

     boolean result = file.mkdirs();
    

提交回复
热议问题