[Python-ideas] Extend the os.stat() result objects with methods like isfile() and isdir()

Christian Heimes christian at python.org
Fri May 3 13:57:12 CEST 2013


Am 03.05.2013 07:22, schrieb Pieter Nagel:
> On Thu, 2013-05-02 at 17:20 -0700, Andrew Barnert wrote:
> 
>> Does Python have stat.S_ISDOOR on Solaris? (It doesn't on other POSIX systems, and it's not mentioned in the docs.)
> 
> In principle I'm all for looking at missing platform-specific stat flags
> while that region of the stdlib is being worked on.
> 
> In practice, though, I only have access to Linux when it comes to
> implementing this. Support for other platforms will most likely depend
> on the availability of volunteers when it comes to implementation.

You can ask Trent Nelson for snakebite.net access. He has lots important
operation systems in his setup. I can also help you if you need
information or testing.

So far I was able to identify this set of file types:

S_ISDIR()
S_ISCHR()
S_ISBLK()
S_ISREG()
S_ISLNK()
S_ISSOCK()
S_ISFIFO()

# Solaris
S_ISDOOR()
S_ISPORT()

# POSIX 1.b real-time extension
S_ISMSG()
S_ISSEM()
S_ISSHM()

# whiteout, translucent file systems
S_ISWHT



More information about the Python-ideas mailing list