RFR 8023173: FileOutputStream(FileDescriptor) does not respect append flag on Windows
ivan.gerasimov at oracle.com
Mon Oct 6 10:41:53 UTC 2014
The append mode is emulated on Windows, therefore we have to keep a flag
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
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.
With the fix, all the io/nio tests, including the new one, pass on all
Would you please help review this fix?
More information about the core-libs-dev