Append-mode I/O on Windows and process I/O redirection
Alan Bateman
Alan.Bateman at Sun.COM
Sun Jun 8 09:46:18 UTC 2008
Martin Buchholz wrote:
> :
> When I first implemented this, keeping track of append mode throughout
> various software layers was a burden. I guess the output streams
> and channels will have to know whether they are in append mode or not.
>
FileOutputStream and FileChannelImpl used to know this before the
changes but you are right that will now impact right down to the code
that does the I/O. Furthermore, it impacts all platforms so careful
testing needed.
> Perhaps it is easiest to implement append mode by using the current
> code that uses FileOutputStream and extracts the HANDLE from that,
> but at the last moment replacing the HANDLE with a new HANDLE
> that has FILE_WRITE_DATA turned off before calling CreateProcess.
>
Assuming you are thinking of ReOpenFile then we would still need a
solution for Windows XP because that Win32 needs Windows Server 2003 or
newer.
-Alan.
More information about the core-libs-dev
mailing list