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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.1.5
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: