>> While we're at it, adding a "recursive" argument to this shutil.chown >> could also be useful. > > I don't like the idea of a recursive flag. I would prefer a "map-like" > function to "apply" a function on all files of a directory. Something > like shutil.apply_recursive(shutil.chown)... >
I was also thinking about this possibility. The advantage is that we could factor-out the recursive walk logic to make it available for other functions (chown, chmod...). It doesn't map well to the Unix command, though. > You can do all of this with an appropriate application of os.walk(). Then, I wonder why shutil.copytree and shutil.rmtree are provided. Recursive rm/copy/chown/chmod are extremely useful in system administration scripts. Furthermore, it's not as simple as it seems because of symlinks, see for example http://bugs.python.org/issue4489 . _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com