Ryan Bloom wrote:
>>From: Greg Stein [mailto:gstein@lyra.org]
>>
>>On Tue, Jun 11, 2002 at 10:10:22PM +0200, Branko Cibej wrote:
>>
>>
>>>...
>>>The solution is to reopen the streams in binary mode, obviously. I
>>>wonder how you do that in APR.
>>>
>>>
>>Pass APR_BINARY to the apr_file_open() function. Not a problem.
>>
>>Of course, it appears that apr/file_io/win32/open.c doesn't even look
>>
>>
>for
>
>
>>that flag :-(
>>
>>
>
>That is a pretty major bug. :-(
>
>
>
>>Hmm. And reopening stdout/stdin in binary mode... oof. No fricking
>>
>>
>clue.
>
>We don't do that currently. You really only have two options as things
>stand today. 1) Close the file and re-open. 2) Implement
>apr_file_reopen (which devolves to option #1 in the worst case
>scenario).
>
>Ryan
>
>
/me has a more evil solution. Use apr_file_open_std*, as that bypasses
the CRT and uses the OS's file handles which don't know or care about
translation. The attached patch works on Win32.
Even if it's not the Totally Right Thing To Do, I vote we put it on
trunk/ and branches/fs-convert-2092/ and roll new tarballs, or at least
Win32 binaries.
--
Brane Čibej http://www.xbc.nu/brane/