Front page | perl.perl6.language |
Postings from November 2008
Re: S16: chown, chmod
Thread Previous
|
Thread Next
From:
Moritz Lenz
Date:
November 21, 2008 11:06
Subject:
Re: S16: chown, chmod
Message ID:
492706D7.6070603@casella.verplant.org
Larry Wall wrote:
> On Fri, Nov 21, 2008 at 07:30:08PM +0100, Moritz Lenz wrote:
> : For chmod() I could imagine an interface like this:
> :
> : $file.chmod(:8<540>);
> : $file.chmod( :set, :user => :r & :x, :group => :r)
> : # both same as 'chmod 540 $file'
> :
> : $file.chmod( :modifiy, :other => :!x)
> : # same as 'chmod o-x $file'
>
> A pair on the left side of => could be construed as a design smell.
oops, I menat 'user => :r' instead of ':user => :r'.
I should take the warning serious that 'sudo' prints out the first time
you use it ;-)
> And I wonder if the set/modify distinction can be better mapped onto
> assignops somehow...
maybe as hash slices?
$file.perms<user><r w x> = 1, 0, 1;
Still that would become clumsy if you want to change the rights for
user, group and other at the same time...
Moritz
--
Moritz Lenz
http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/
Thread Previous
|
Thread Next