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

java.io.File.isDirectory returns false on path "C:"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.5
    • core-libs
    • x86
    • windows_nt



      Name: paC48320 Date: 04/24/98


      Here is the java program.
      ------------
      import java.io.*;
      public class TestFile {
      public static void main(String[] args) throws IOException {
      File file = new File(args[0]);
      System.out.println(file.isDirectory());
      System.out.println(file.list());
      }
      }
      ------------

      When compiling and running (JDK1.1.5) on WinNT4.0,
      the outcome is:
      -----------------
      % java TestFile C:
      false
      [Ljava.lang.String;@2069aa

      -----------------

         In the test program, assuming as a drive letter that <drive> exists,
         when running "java TestFile <drive>:", list() returns NON null, however
         isDirectory() returns false.
         For "<drive:>", I think that isDirectory() should return true.
         Please clarify it.
      (Review ID: 28947)
      ======================================================================

            mr Mark Reinhold
            pallenba Peter Allenbach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: