You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Greg Stein <gs...@lyra.org> on 2002/06/12 00:35:29 UTC

Re: repository conversion on windows fails / binary file

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 :-(

Hmm. And reopening stdout/stdin in binary mode... oof. No fricking clue.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: repository conversion on windows fails / binary file

Posted by Branko Čibej <br...@xbc.nu>.
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   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: repository conversion on windows fails / binary file

Posted by Branko Čibej <br...@xbc.nu>.
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   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: repository conversion on windows fails / binary file

Posted by Branko Čibej <br...@xbc.nu>.
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.   :-(
>  
>
It's not that bad, really. The Win32 apr_file_t uses the OS's file 
handles, which don't know about newline translation and stuff. So 
APR_BINARY is actually what you get. The "bug" is that you can't turn 
 it off, e.g., APR doesn't do newline translation for you.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/



RE: repository conversion on windows fails / binary file

Posted by Ryan Bloom <rb...@covalent.net>.
> 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



RE: repository conversion on windows fails / binary file

Posted by Ryan Bloom <rb...@covalent.net>.
> 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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org