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

Re: [PATCH] Make working copies read-only.

From: Branko Èibej <brane_at_xbc.nu>
Date: 2001-12-01 09:54:54 CET

Greg Hudson wrote:

>On Fri, 2001-11-30 at 09:02, Kevin Pilch-Bisson wrote:
>
>>>>Also even if we didn't we wind up with a read-only file in the working copy.
>>>>
>
>We should only wind up with a read-only file in the working copy if we
>open it read-only when we create it or set it read-only afterwards.
>We're doing the copy here; we can open the target file with whatever
>mode we want. If svn_io_copy_file() or apr_copy_file() does the wrong
>thing for this purpose, then we should make it more flexible or create a
>variant; playing games with umask to compensate is going in the wrong
>direction.
>

Right. I think it's also time somebody (me :-) pointed out that umasks
and permission bits are a Unix-ism, and what you're doing here does not
map nicely to (for instance) the read-only bit on Windows filesystems.
We need a more abstract interface that doesn't mix write-protection and
file permissions. For example:

    apr_file_[get/set]_perms
    apr_file_ [get/set]_read_only
    apr_file_[get/set]_executable

On Unix, all of these would all map to twiddling permission bits. On
Windows, for instance, the first would touch the file's ACL, the second
would touch it's read-only bit, and the third is a no-op. And Subversion
doesn't need (and shouldn't use, IMO) the first at all.

-- 
Brane �ibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:50 2006

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.