You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Matt Benson <gu...@yahoo.com> on 2005/03/03 23:42:45 UTC

Re: Purpose of FileUtils.close(...)

PING...
--- Matt Benson <gu...@yahoo.com> wrote:
[SNIP]
> In
> talking about whether caught Exceptions should at
> least be logged, Jesse mentioned "disk full" as an
> example.  We actually have a bugrep (32676) about
> full
> directories, and I found a blog today on which a
> German fellow has posted a workaround to detect this
> condition when writing with a FOS, using the sync()
> method of the descriptor available from the stream. 
> We could insert this in our own FOS deriving from
> java.io.FOS; we could write our own FileWriter to
> use
> an instance of (hypothetically) oata.util.FOS and
> force the Exception on full disk.

Any more opinions on this? We could add this to
LazyFileOutputStream and check whether performance
degrades as Jesse has mentioned he fears.

>  But it won't help
> anything unless we log Exceptions from
> FileUtils.close(*)... So I am for at least writing
> to
> System.err .
> 
> Another thought:  We could create an AntThread class
> to tie a Thread to a Project.  Most places that
> currently use Thread constructors would use the same
> AntThread constructor.  The top-level AntThread
> could
> be constructed with an explicit Project; others
> could
> inherit the Project from the AntThread along whose
> path of execution the child AntThreads were created.
> 

I have been playing with this... I renamed the class
ProjectThread, but the concept is the same.  It seems
like the perfect mechanism to log from e.g.
StreamPumper, which not only has no Project of its
own, but because it is designed to run in a Thread, is
ill-advised to throw Exceptions.  But this seems like
kind of an unorthodox addition to the codebase, so I
wanted to get some feedback.

Thanks,
Matt



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Purpose of FileUtils.close(...)

Posted by Peter Reilly <pe...@apache.org>.
Matt Benson wrote:

>PING...
>--- Matt Benson <gu...@yahoo.com> wrote:
>[SNIP]
>  
>
>>In
>>talking about whether caught Exceptions should at
>>least be logged, Jesse mentioned "disk full" as an
>>example.  We actually have a bugrep (32676) about
>>full
>>directories, and I found a blog today on which a
>>German fellow has posted a workaround to detect this
>>condition when writing with a FOS, using the sync()
>>method of the descriptor available from the stream. 
>>We could insert this in our own FOS deriving from
>>java.io.FOS; we could write our own FileWriter to
>>use
>>an instance of (hypothetically) oata.util.FOS and
>>force the Exception on full disk.
>>    
>>
>
>Any more opinions on this? We could add this to
>LazyFileOutputStream and check whether performance
>degrades as Jesse has mentioned he fears.
>
>  
>
I do not think that we should do this. We should not try to outguess the
OS (never mind java). File.close() corresponds to a OS close call.

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org