Re: deleteOnExit() doesn't work in Tomcat on temp files

2004-12-09 Thread Shankar Unni
Noel J. Bergman wrote: Instead, use the PhantomReference-based code that I contributed to Jakarta Commons. The main reason why people (misguidedly) use deleteOnExit() is to be able to generate temporary files that you can return URLs for (e.g. you generate a .PDF report, and generate an HTTP

deleteOnExit() doesn't work in Tomcat on temp files

2004-12-08 Thread eph1v3t8-list8124
I've run into a bug that I only experience in Tomcat. If, within a servlet, I create a temporary file using File.createTempFile(...), Tomcat puts the file in its temp directory, which is fine. However, if I call deleteOnExit() on the file, the file doesn't get deleted when Tomcat is shut

Re: deleteOnExit() doesn't work in Tomcat on temp files

2004-12-08 Thread Shankar Unni
[EMAIL PROTECTED] wrote: I am using Tomcat 5.5 on WindowsXP. Tomcat is installed as a service, Somehow when Tomcat is installed as a Windows service, the shutdown doesn't go through the orderly steps (i.e. servlet destroy()s aren't called, and I suspect the process is just *killed* instead of

RE: deleteOnExit() doesn't work in Tomcat on temp files

2004-12-08 Thread Noel J. Bergman
DO NOT EVER use deleteOnExit(). Especially not in something like a web app, which has an indeterminate but generally long lifetime. Consider the API removed from Java. Period. Instead, use the PhantomReference-based code that I contributed to Jakarta Commons. (A) it works. (B) it cleans up