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

Temporary files generated by Java applications remain when VM terminates

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.4.0_01
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      This bug has been filed to add the missing functionality for deleteOnExit
      function in java.io.File class.

      Whenever a temporary file is created by an application using "createTempFile" function of java.io.File, deleteOnExit function registers with the VM that it should be deleted when the VM exits.

      However, this is valid only for normal termination of the VM. If a signal
      terminates the VM, like Ctrl-C, the temporary file does not get deleted and hence the temporary files start getting adding up.

      This behavior has been observed in Windows.

      The attached test file, "tempfiletest.java" can be run in any Windows NT machine
      after changing the third argument of line 10. This is to specify the directory
      on the local machine where the temporary file needs to be generated.

      After compiling and running the test program, it is observed that the temporary
      file is generated while the for loop is running. However, if the VM terminates
      normally, the temporary file gets deleted on it's own. If Ctrl-C is done while
      the for loop is on, the temporary file remains behind.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kkladkosunw Konstantin Kladko (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: