RFR: 6244047: impossible to specify directories to logging FileHandler unless they exist
Alan Bateman
Alan.Bateman at oracle.com
Sat Nov 10 10:54:47 UTC 2012
On 09/11/2012 22:41, Jason Mehrens wrote:
> Jim,
>
> You might just want to change the code to create and close a FileOutputStream in a way that doesn't truncate or damage the target file. Or maybe use the NIO file code if that is possible. See BUG ID 4420020.
>
> Jason
I think so too. As it needs a FileChannel anyway, then it may be simpler
to just use FileChannel.open(lf, WRITE), that won't truncate the file
and will also throw a useful IOException in the event that it fails. As
there are specific IOException thrown for specific cases then it may be
possible to eliminate the loop completely for I/O error cases.
-Alan
More information about the core-libs-dev
mailing list