develooper Front page | perl.perl6.language | Postings from March 2006

UNIX commands: chmod

Thread Next
Gabor Szabo
March 25, 2006 02:58
UNIX commands: chmod
Message ID:
Hmm, I don't really know how to do this but Gaal told me to
write up some proposal here.

So we had chmod in Perl5, I would like to make sure it works in
Perl6 as well with slight modifications.


1) In list context it would return the names of the files successfully
     changed .
     In scalar context it should be the number of files successfully changed
     as it is in Perl5
2) In addition to the octet representation it would also be ready to receive
    the unix style mode representation which is string
     one or more of the letters ugoa,
     one of the symbols +-=
     one or more of the letters rwxXstugo

3) While some of the modes are UNIX specific, it would be nice to find similar
    modes in other operating system and do the right thing there too.
    e.g. "all" in UNIX would map to "Everyone" in Windows/NTFS

4) "filename".chmod(MODE)  should also work and I guess
    <file1 file2 file3>.chmod(MODE) should also work on those 3 files

I committed a test file t/builtins/system/chmod.t
but we really need the built in stat() function in order to test this.


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