Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 68369 invoked from network); 25 Jan 2005 16:18:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jan 2005 16:18:41 -0000 Received: (qmail 33579 invoked by uid 500); 25 Jan 2005 16:18:37 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 33512 invoked by uid 500); 25 Jan 2005 16:18:37 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 33496 invoked by uid 99); 25 Jan 2005 16:18:36 -0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web30903.mail.mud.yahoo.com (HELO web30903.mail.mud.yahoo.com) (68.142.200.156) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 25 Jan 2005 08:18:35 -0800 Received: (qmail 30608 invoked by uid 60001); 25 Jan 2005 16:18:33 -0000 Message-ID: <20050125161833.30606.qmail@web30903.mail.mud.yahoo.com> Received: from [65.247.233.11] by web30903.mail.mud.yahoo.com via HTTP; Tue, 25 Jan 2005 08:18:32 PST Date: Tue, 25 Jan 2005 08:18:32 -0800 (PST) From: Matt Benson Subject: Re: Purpose of FileUtils.close(...) To: Ant Developers List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --- Jesse Glick wrote: > Matt Benson wrote: > > [...] In talking about whether caught Exceptions > should at least be > > logged, Jesse mentioned "disk full" as an example. > [...] I found a > > blog today [with] 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. > > [...] > > This sounds overly complicated to me. Wouldn't it be > much easier to use > a plain FOS, assume that OutputStream.close() will > throw an IOException > if something is broken, as its Javadoc says, and if > caught rethrow this > as a BuildException in the usual way? The problem, Jesse, is that the Exception won't be thrown unless you explicitly sync() the FileDescriptor; otherwise the write will take place in cache and the result on disk later will be a zero-byte file. That's how I understood the problem, anyway. -Matt > > -J. > > -- > Jesse Glick x22801 > NetBeans, Open APIs > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > dev-unsubscribe@ant.apache.org > For additional commands, e-mail: > dev-help@ant.apache.org > > __________________________________________________ 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