develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [PATCH] File::Copy & permission bits.

Thread Previous | Thread Next
Aristotle Pagaltzis
June 9, 2008 06:34
Re: [PATCH] File::Copy & permission bits.
Message ID:
* Craig A. Berry <> [2008-06-09 15:05]:
> Before Abigail's patch, the Unix copy() did roughly what the
> VMS and Win32 syscopy() implementations do: it followed "new
> file" semantics and created the target file with permissions
> inherited from the target environment.

Except, there is no such thing as permissions inherited from the
target environment on Unix. Maybe you could consider the exec
bits on the directories that are part of a file’s path some kind
of permission inheritance, but even that is a bit of a stretch.

> I don't like the fact that copying from a handle now gives
> different behavior permissions-wise than copying from a
> filename, but that inconsistency could be ironed out pretty
> easily.

I always argued that the code to preserve permissions should go
into `syscopy` on Unix, not `copy`.

If, as Charles seems to have been suggesting, `cp` was aliased
depending on platform to *either* `copy` *or* `syscopy` such that
it emulated the platform copy program, that would be ideal.

Then people could explicitly ask for either behaviour when they
mean it, or could use the DWIM alias (which is also shortest to
type) when upgrading scripts from sh/CMD.EXE/DCL/whatever.

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About