[Python-Dev] Extending os.chown() to accept user/group names (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Thu May 26 07:58:16 CEST 2011
- Previous message: [Python-Dev] Extending os.chown() to accept user/group names
- Next message: [Python-Dev] Extending os.chown() to accept user/group names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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).
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.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] Extending os.chown() to accept user/group names
- Next message: [Python-Dev] Extending os.chown() to accept user/group names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]