--- Jesse Glick <[EMAIL PROTECTED]> 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 <mailto:[EMAIL PROTECTED]> x22801 > NetBeans, Open APIs <http://www.netbeans.org/> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]