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

java.io.File.getParent() incorrectly returns null for "/usr"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • core-libs
    • None
    • sparc
    • solaris_2.5.1



      Name: mc57594 Date: 02/12/97


      File still does not understand that "/" is the parent of "/usr".

      Run the following on a Solaris system:

      import java.io.File;

      class FileTest {

          public static void main(String args[]) {
      File file = new File("/usr"); // Or /anything
      System.out.println("Parent of /usr is: " + file.getParent());
          }
      }

      Output is:

      Parent of /usr is: null

      Should be:

      Parent of /usr is: /
      company - Vignette Corporation , email - ###@###.###
      ======================================================================

            mr Mark Reinhold
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: