[Python-ideas] PEP: Extended stat_result (First Draft)

Christian Heimes christian at python.org
Tue May 7 14:29:58 CEST 2013


Am 07.05.2013 06:09, schrieb
random832 at fastmail.us:
> On Mon, May 6, 2013, at 21:19, Andrew Barnert wrote:
>> But fixing that requires just a one-line comment saying something like,
>> "These values are not standardized, they just happen to work on every
>> platform this version of this module is used with."
> 
> On the subject of platforms they _don't_ work with... What happens to
> code that hardcodes values like 0o644 on such platforms? I suspect there
> is more code than there otherwise would have been due to these constants
> not being in the os module where stat, open, mkdir, and chmod live (and
> it doesn't break on the author's system).

The Open Group specifies names *and* numeric values for the permission
bits:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Any POSIX compatible ought to use this values. I don't see an issue for
permission bits. The S_IF* constants are a whole different story, though.





More information about the Python-ideas mailing list