You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Hans-Joachim Matheus <Ha...@in-gmbh.de> on 2002/04/19 16:50:16 UTC

File delete problem solved? Was: Re: Any news about Bug #3465 ass igned to Mike Schachter?

Hi Mike,

after sitting a long time staring at my code I found the
"bug" which isn't a bug at all.

If you say "myFormFile.getInputStream()" and then try to
"myFormFile.destroy()" there must be an "inputStream.close()"
inbetween. Otherwise there is an open file descriptor on the
file and even JDK isn't able to delete it.

Maybe this should be inserted in the javadoc of "getInputStream"
method of FormFile and DiskFile !?

I hope that I helped to solve that problem a little bit...

Cheers from the lake of Constance, Germany,
Jochen

-- 
mailto:Hans-Joachim.Matheus@in-gmbh.de \
in-integrierte informationssysteme GmbH \
Am Seerhein 8     Tel +49 (0)7531/8145-0 \
D-78467 Konstanz                  Fax -81 \
-------------------->http://www.in-gmbh.de \



Von: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:mschachter@hp.com]
> 
> That bug's been around for a long time. The reason it
> remains there is because I've never been able to verify
> it; but I've seen the problem with the java.io.File.delete()
> method in the past with other projects. Have you verified
> that the bug exists in your application?
> 
> -----Original Message-----
> From: Hans-Joachim Matheus [mailto:Hans-Joachim.Matheus@in-gmbh.de]
> Sent: Friday, April 05, 2002 11:11 AM
> To: struts-dev@jakarta.apache.org
> Subject: Any news about Bug #3465 assigned to Mike Schachter?
> 
> 
> Hi,
> 
> I wonder if there is any news about this bug?
> Maybe this has something to do with the path
> and the permission to delete a file?
> 
> I wonder why first the ServletContext attribute 
> "javax.servlet.context.tempdir" is used and if this
> is null then the Servlet Init Parameter "tempDir" is
> used and not vice versa.
> 
> In Tomcat 3 the "javax.servlet.context.tempdir" is the
> dir where jasper compiles the jsps (i.e. the worker dir).
> Does this mean that struts has no permission to delete
> files in there?
> 
> If I have a WebApp with many file uploads this is very
> bad because of an ever growing temp dir.
> 
> Thanks for your hints...
> 
> Hans-Joachim Matheus
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>