I've entered a bug in bugzilla and attached my patch to it: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17512
Please note I was only able to confirm that it compiles, runs, and fixes the problem in my environment. I wasn't able to run the tests so whoever is interested in committing this should at a minimum run the proper tests (which I'm sure you do anyways). Thanks, Jim, for pointing me towards the proper class to fix. It was mentioned by someone on ant-user that similar bugs occur in a few other classes that use temporary files, such as the junit task, but I'm not brave enough to touch too many files. :) Marc -----Original Message----- From: Marc Novakowski Sent: Thursday, February 27, 2003 11:57 AM To: Ant Users List Subject: RE: Jikes creating temporary files on windows I just did a test -- and calling File.deleteOnExit() after creating the temp file WORKS. It fixes the problem I was seeing where the temp files would not be cleaned up when hitting CTRL-C. The patch is pretty easy, I just added the following line to the DefaultCompilerAdapter.java class in the executeExternalCompile(...) method (as Jim suggested): tmpFile.deleteOnExit(); (line 424 in the 1.5.1 src distro) Marc -----Original Message----- From: Jim Allers [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 11:17 AM To: Ant Users List Subject: RE: Jikes creating temporary files on windows It does use a finally block to delete the temp file, but since ctrl-C causes the VM to shutdown, the finally block is never reached. What would probably work in this case is File.deleteOnExit() or a shutdown hook. I would probably prefer File.deleteOnExit(). If you are comfortable building the ant source, you can modify org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeEx ternalCompile() to invoke tmpFile.deleteOnExit() and see if that solves your problem. -----Original Message----- From: Marc Novakowski [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 12:25 PM To: Ant Users List Subject: RE: Jikes creating temporary files on windows I haven't looked at the Ant source code, but is there any way to delete the temporary file using something like a "finally" block or Java's File.createTempFile() auto-deletion (if that works)?? Or does the fact that CTRL-C kills not just the app but the entire VM mean that neither of these will work? Marc -----Original Message----- From: Jim Allers [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 7:41 PM To: Ant Users List Subject: RE: Jikes creating temporary files on windows If you set fork="true" and use "javac", i think it will still create the temporary file. The temporary file is created by Ant when the list of source files is too big to passed through the command line. -----Original Message----- From: Marc Novakowski [mailto:[EMAIL PROTECTED] Sent: Wed 2/26/2003 7:00 PM To: user@ant.apache.org Cc: Subject: Jikes creating temporary files on windows When compiling a large number of classes at once, it appears that when Ant is configured to use jikes it will create a temporary file called "filexxxx" or "file-xxxx" where xxxx is some random number. The temporary file contains a list of all the java files being compiled. It then removes this file when the jikes is complete. However, if the compile is interrupted (such as hitting CTRL-C when a long list of compile errors is being spewed back), it will fail to delete the temporary file. If I switch the compiler to "javac" it doesn't appear to create any temporary file. Is this a known bug? Is there some way to work around it other than to add a <delete> task to my clean target to get rid of "file*" files (which may be dangerous). My configuration is as follows: - Apache Ant version 1.5.1 compiled on October 2 2002 - Windows 2000 Professional - Jikes 1.18 (also tried Jikes 1.15 with same results) Thanks, Marc --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]