[Python-ideas] More friendly access to chmod
Chris Angelico
rosuav at gmail.com
Sat Jan 9 11:11:13 EST 2016
On Sun, Jan 10, 2016 at 3:06 AM, Ram Rachum <ram at rachum.com> wrote:
> Thanks for the reference. Personally I think that `my_path.stat().st_mode &
> stat.S_IXGRP` is not human-readable enough. I'll work on a nicer API.
> Probably this for the same action you described:
>
> 'x' in my_path.chmod()['g']
>
>
Okay. I'm not sure how popular that'll be, but sure.
As an alternative API, you could have it return a tuple of permission
strings, which you'd use thus:
'gx' in my_path.mode() # Group eXecute permission is set
But scratch your own itch, and don't give in to the armchair advisers.
ChrisA
More information about the Python-ideas
mailing list