RFR 8023173: FileOutputStream(FileDescriptor) does not respect append flag on Windows

Martin Buchholz martinrb at google.com
Mon Oct 6 17:22:15 UTC 2014


Thanks for tackling this difficult area!

Alan is the most qualified to review, but I'll throw in some comments.

The title of the bug in jira doesn't match the one in the webrev - they
should be the same.

I'm not sure, but it looks like getAppend is called even on non-Windows
platforms, but there should be no need?

On Mon, Oct 6, 2014 at 3:41 AM, Ivan Gerasimov <ivan.gerasimov at oracle.com>
wrote:

> Hello everybody!
>
> The append mode is emulated on Windows, therefore we have to keep a flag
> indicating that.
>
> With the current implementation, the FileDescriptor does not know if the
> file were opened with O_APPEND, and the flag is maintained at the upper
> level.
> This can cause inconsistency, when the FileDescriptor is reused to
> construct a new FileOutputStream, as there is no information available
> about the append/non-append mode.
>
> Even though the solution is quite straight-forward: moving the flag from
> FileOutputStream,  FileDispatcherImpl and FileChannelImpl to the lower
> level of FileDescriptor, it touches 20 files across the source-code base.
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8023173
> WEBREV: http://cr.openjdk.java.net/~igerasim/8023173/0/webrev/
>
> With the fix, all the io/nio tests, including the new one, pass on all
> available platforms.
>
> Would you please help review this fix?
>
> Sincerely yours,
> Ivan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141006/7cf871f6/attachment.html>


More information about the nio-dev mailing list