Library wish: rchown and rchmod

Don Garrett garrett at bgb.cc
Mon Nov 5 22:14:34 CET 2001


  I've had to do things like this several times, but I always
need to have some extra's thrown in, such as wanting directories
to have the set-gid mask set, but not files, etc.

  I have never come up with a one-size fits all utility for managing
this, but the os.path.walk seems to work well for me.

  I have to admit that realizing that the single argument it will pass 
along to the visitor function could be list with an arbitrary number
of values was very useful. In fact, it was something of a Python
epiphany about how to solve a long standing problem I've had with
separating traversal and visitor code (and other similar problems).

  If only that trick worked in C++. ;>

Gerhard Häring wrote:
> 
> On Sun, Sep 30, 2001 at 07:10:57AM +0200, Boyd Roberts wrote:
> > "Gabriel Ambuehl" <gabriel_ambuehl at buz.ch> a écrit:
> > > rchown and rchmod (recursive chown and recursive chmod) (I don't care
> > > for the name but only for the functionality ;-).
> >
> > i'd suggest something like ftw(3) and call 'em with that.
> 
> We already have os.path.walk. Though I'm anything but happy with this
> interface. I normally build my recursive tree walking myself.
> 
> Other than that, I'd find the originally proposed functions useful.
> That's something I often need on the shell.
> 
> Gerhard
> --
> mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
> web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
> public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
> reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
> 
>   ------------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature

--
Don Garrett                     http://www.bgb-consulting.com/garrett/
BGB Consulting                                        dgarrett at acm.org



More information about the Python-list mailing list