5 Replies Latest reply: Nov 19, 2008 8:07 PM by 843785 RSS

    how to release file lock

    843785
      hi. a function in my program deletes a file (file.txt) creates a temporary file (tempfile.txt) and then once it finishes writing it renames it to (file.txt) through
      tempFile.renameTo(newFile)
      this section works just fine for the first run. however, if i try to call the method again. the function fails to delete (file.txt) due to write protection. i was wondering if there was any way for me to manually release the file locking through java. thanks in advance