Creation of directory with name nul.txt is not allowed in Windows but, File.{mkdir,mkdirs}() always returns true for this file name. It looks, Cr's 4858457,5043449,6176051 raises similar issue, but doesnt mention methods mkdir/mkdirs.
Executing the following program n number of times will have same result.
import java.io.File;
public class TestFile {
public static void main(String... args) {
File f = new File("nul.txt");
System.out.println("mkdir "+f.mkdir());
System.out.println("mkdirs "+f.mkdirs());
}
}
Should say inability of creation of this directory (or) any reserved word in Windows by returning false.
Executing the following program n number of times will have same result.
import java.io.File;
public class TestFile {
public static void main(String... args) {
File f = new File("nul.txt");
System.out.println("mkdir "+f.mkdir());
System.out.println("mkdirs "+f.mkdirs());
}
}
Should say inability of creation of this directory (or) any reserved word in Windows by returning false.