Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6565079

File.mkdir{s}?() always returns true for a file name nul.txt (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7
    • core-libs
    • Cause Known
    • x86
    • windows

      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.

            Unassigned Unassigned
            rgutupalsunw Rajendra Gutupalli (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: