Getting major/minor number of device file in Linux?

Grant Edwards grante at visi.com
Sat Jul 14 17:47:42 EDT 2001


In article <Hj247.15606$B7.2808728 at ruti.visi.com>, Grant Edwards wrote:

>I can't figure out how to get the major and minor numbers of a
>char special file under Linux.  What I want is the st_rdev
>field of the stat struct, but os.stat doesn't seem to return
>that field.

It doesn't appear that the posix module wraps the mknod() call
either, so I guess the inability to deal with device special
files is at least consistent.

-- 
Grant Edwards                   grante             Yow!  Did we bring enough
                                  at               BEEF JERKY?
                               visi.com            



More information about the Python-list mailing list