Well, it sounds like the objects that opened the
stream in the first place still have the stream open,
so you cannot delete the files. Subsequently unloading
the servlet destroys these objects and the streams are
automatically closed.

So what you could do is hand off the logging to
another object. When you request a new log file name (
I am unclear when exactly this is done ), if the
stream is open, close it and then open it again to the
new file name. In that way, the old files will be
"deletable" as soon as a new log file is created.

Does that help ?

//Nicholas

--- "Kathiresan, Vallikun" <[EMAIL PROTECTED]>
wrote:
> We have a static log file for each object in the
> program to record every
> activity of the user. When we recompile the program
> and access it again new
> log files are created because they are date & time
> stamped.
>
> But we are not able to delete the previous ones that
> are created. We have to
> unload the servlet in order to delete them.
>
> What should we do to unreferenc these old ones, so
> they would be released?
> In other words when should we close these streams so
> that they are available
> to be deleted.
>
> Any ideas, suggestions would be greatly appreciated.
>
> Thanks a lot
> Vallikun
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>


=====
"And what causes me to run?
'Cause you're a...
Big Black Furry Creature From Mars"


--
Nicholas Whitehead
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to