PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3088 *** shadow/3088 Fri Aug 10 10:49:29 2001 --- shadow/3088.tmp.15477 Fri Aug 10 10:49:29 2001 *************** *** 0 **** --- 1,31 ---- + +============================================================================+ + | Resource handle on processed XSLT output still open | + +----------------------------------------------------------------------------+ + | Bug #: 3088 Product: Ant | + | Status: NEW Version: 1.3 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: Optional Tasks | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + I have a target in my build.xml file that uses the <style> element to process an + an XSLT file and puts the output in a temporary destination directory. Before + the <style> element is called, there is a <delete> element that actually deletes + everything in the temporary directory BEFORE it does the processing. This is + the same for a number of targets. The problem is... after one target is + processed, and another begins... it fails at the <deletion> stage because the + old target still has an open resource handle to the output file in the temporary + directory... and Windows won't allow you to delete any directory or file if + there is still an open handle on it. + + I looked through the ANT code... and noticed in the TraxLiaison.java class that + a FileOutputStream is created and passed on the same line to the javax + transformer. I changed the code to create the outputstream before the + transformer, pass it on the transformer, then close the outputstream after the + transformation. And that worked. \ No newline at end of file
