develooper Front page | perl.perl5.porters | Postings from January 2009

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

Thread Previous | Thread Next
Rafael Garcia-Suarez
January 25, 2009 06:11
Re: [PATCH] Re: [PATCH] File::Copy & permission bits.
Message ID:
2009/1/25 Charles Bailey <>:
> Well, I finally found a couple of tuits, and spent one learning
> elementary git-fu, and the other on the attached patch.  It does the
> following:

Thanks, applied as e63b33793c3cf76a134a6446d1f83479e030a15f
(but lines unwrapped by hand.)

> - Moves the permission-changing code to File::Copy::cp(), making it
> non-identical to File::Copy::copy().  I think this is a decent
> compromise, retaining backwards compatibility in the "primary"
> routine, while allowing people who chose cp() to get more POSIXy
> semantics.  It does break backwards compatibility of cp() wrt
> permissions.  I can find a handful of examples in CPAN, for which I
> hope smokers will give some feedback.  As for the DARKpan, who knows .
> . .
> - Expands the permission changing in cp() a bit to cover the rest of
> what cp(1) claims on the local POSIX box.
> - Removes Fcntl from the mix, to eliminate some build-time hoops.
> - Shifts Abigail's permission tests to cp(), and adds parallel tests for copy().
> - Documents the permission-related behavior in more detail.
> It DOESN'T do the following:
> - Make the permission changes in cp() conditional on an import key or
> somesuch.  That'd retain backwards compatibility by default; do we
> want to take this approach?

As we can consider the current behaviour a bug, no.

> - Test the handling of setid bits.  Doing this properly would required
> chown, and hence root, which doesn't strike me as belonging in the
> regular test suite.  It looks like we don't test chown itself in this
> way, so I figured adding skip-unless-I'm-root tests was overkill.


> - Remove Scalar::Util.  It looks possible to replace the blessed() and
> overload() checks with something like
>    my $ra = ref $a;  "$a" !~ /^$ra\(0x[0-9a-f]+\)$/
>  but I need to think it through a bit more and test it.

That wouldn't work with scalars with "" overload, I think.

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