[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [APR] apr_file_copy() improvements

From: Michael Sweet <mike_at_easysw.com>
Date: 2006-03-10 17:10:25 CET

Branko Čibej wrote:
> Julian Foad wrote:
>> Since several of you are APR developers, I wonder if one of you would
>> be keen to take up the following issues with apr_file_copy(). We've
>> now got several reasons to re-work it:
>>
>> Correctness:
>>
>> We (Subversion) expect it to do a byte-for-byte copy. To achieve this
>> on some less-common platforms, we have:
>>
>> * Paul Burba's work-around for OS400 going into Subversion.
>>
>> * Max Bowsher's patch for CygWin that he makes to APR when building it.
>>
>> If the APR developers can agree that that is the intended behaviour,
>> both of those patches would be eliminated by documenting that
>> apr_file_copy performs a byte-for-byte copy, and making it open the
>> source and destination in "binary" mode to achieve this. The
>> behaviour would be unchanged on Unix-like platforms.
>>
>>
>> Speed:
>>
>> * Implementation for MS Windows should use the OS's native "file copy"
>> API for much faster performance (and probably better performance in
>> terms of preserving permissions, etc.).
>>
>> * Ditto on any other platforms that provide such an API.
>>
>> * Other implementations should use a buffer bigger than BUFSIZ.
> I agree with all of the above, but note that in order for these changes
> to be useful for Subversion, we'll have to implement them on APR's trunk
> and backport to the 1.2.x and 0.9.x branches. Nowever, I'm not sure we
> can actually rely on the changes being in APR, unless we unilaterally
> stop supporting older versions of APR after these changes go into an APR
> release.

Would it make sense to rev the API, then, so that Subversion can
look for the new API and fall back to its own implementation when
thew new API is not present?

The new API could provide an explicit "binary copy" argument so that
The Right Thing is done on all platforms for both text and binary
files.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 10 17:11:37 2006

This is an archived mail posted to the Subversion Dev mailing list.