stat st_rdev in python

Louis Glassy glassy at esus.cs.montana.edu
Fri Jul 27 18:08:36 EDT 2001


Is there a way to find out unix device major/minor numbers
_in_ Python 2.1, without using an external C module or program?

The tuple returned by os.stat() does not return the stat 
st_rdev field, which contains the information I need.

I see two options:  either write my own binding to stat(2)
or do something like a popen on /bin/ls.  These both work,
though neither is attractive.  It'd be nice if there were
an unaldulterated posix module that I could call and get
what everything that stat(2) would return.

Suggestions?

Thanks in advance, and thanks particularly to all the Python
developers for making the language a pleasure to work with!
:-)

lou




More information about the Python-list mailing list