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

java.io.File.getName can return more than file name

XMLWordPrintable

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



      Name: diC59631 Date: 05/26/98


      Call to File.getName() returns the full pathname
      and not only the pure filename.

      Try this

      File f = new File("a/b/c");
      System.out.println(f.getName());

      on Solaris this is fine. on win32 jdk1.1.6 you will get "a/b/c" NOT just "c" as it should

      (Review ID: 27146)
      ======================================================================

            mr Mark Reinhold
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: