A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-May/111674.html below:

[Python-Dev] Extending os.chown() to accept user/group names

[Python-Dev] Extending os.chown() to accept user/group namesPetri Lehtinen petri at digip.org
Thu May 26 08:09:04 CEST 2011
Nick Coghlan wrote:
> 2011/5/26 Charles-François Natali <neologix at free.fr>:
> > 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
> 
> Rather than a fixed binary flag, I would suggest following the
> precedent of copytree and rmtree, and provide recursive functionality
> as a separate shutil function (i.e. shutil.chmodtree,
> shutil.chowntree).

+1

> As noted, while these *can* be written manually, it is convenient to
> have the logic for handling symlinks dealt with for you, as well as
> not having to look up the particular incantation for correctly linking
> os.walk and the relevant operations.

This is exactly what I meant when saying that the -R option to chown
and chmod shell commands is useful. I *could* do it without them, but
writing the same logic every time with error handling would be
cumbersome.

Petri
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4