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

Unable to delete a directory unless it has no files in it.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P2 P2
    • None
    • 1.1
    • core-libs
    • None
    • sparc
    • solaris_2.5



      Name: el35337 Date: 01/09/97

      The following test case shows JDK1.1beta2's failure to
      delete a
           directory if the directory has files in it. If it is compiled
      under
           JDK1.1beta2, it fails to delete if there are files in the
      directory. If
           the DeleteBug.java application is compiled under JDK1.0, it deletes
      a directory
           including any files it has in it which is DeleteBug.javawhat delete
      should do.
      _______________________________________________________________________________________
      dogzilla# javac DeleteBug.java <---compiled with JDK1.1beta2
      dogzilla# mkdir a_test_directory
      dogzilla# touch a_test_directory/foo
      dogzilla# ls
      DeleteBug.class DeleteBug.java a_test_directory
      dogzilla# java DeleteBug
      dogzilla# ls
      DeleteBug.class DeleteBug.java a_test_directory <---Should have
      have
      dogzilla# been deleted
      dogzilla# cat DeleteBug.java
      import java.io.*;
       
      class DeleteBug {
           DeleteBug() {
           }
           public static void main(String args[]) {
                File a_Directory = new File("a_test_directory");
                a_Directory.delete();
           }
      }

      _______________________________________________________________________________________
       
       
      ======================================================================

            djbrown David Brown (Inactive)
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: