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

Re: svn_io_file_rename preserves *destination* file permission on Windows

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-11-14 23:45:58 CET

Erik Huelsmann wrote:
>> This behavior was added in r14304 by Brane for fix issue #2278. I
>> understand for what we clear destinition file's read-only.
>> On Linux mv doesn't preserves destination permisions, why we have
>> different behavior on Windows?
>>
>
> To jump in:
>
> On unix, you can rename over a read-only file. The *source*
> permissions in this operation are preserved (and -ofcourse- attached
> to the destination after the rename).
>
First let me point out that there is a big difference between the
read-only flag and file permissions on Windows.

As far as I can remember, this change was made in order to preserve
svn:needs-lock semantics during update in the Windows working copy. It's
possible that it would work just as well if was_read_only was read off
the source, not the target; I certainly wouldn't want to blindly change
things.

I think that, if you trace back through the update sequence, you'll find
that when replacing a file's contents in the working copy, the temporary
file (i.e., before svn_io_file_rename is called) will have the same
read-only state as the target file.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 14 23:46:29 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.