mkdir() is not creating the new directory

后端 未结 7 2215
庸人自扰
庸人自扰 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:23

    its obj.mkdirs()

    have a look to this:

    File  f = new File("non_existing_dir/someDir");
    System.out.println(f.mkdir());
    System.out.println(f.mkdirs());
    

    The first print won't create a directory and returns false but the second does and returns true

提交回复
热议问题