[Python-bugs-list] [Bug #111481] os.stat() doesn't return st_rdev

noreply@sourceforge.net noreply@sourceforge.net
Tue, 29 Aug 2000 21:51:23 -0700


Bug #111481, was updated on 2000-Aug-09 06:38
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: Feature Request
Priority: 5
Summary: os.stat() doesn't return st_rdev

Details: The call os.stat() returns the fields st_mode, st_ino,
st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime
st_ctime from "struct stat".
To be able to explore device nodes on a linux system
the field st_rdev needed as the major and minor device number is stored in this field.
It would be nice if it could be added as an extra element
in the tuple returned by os.stat, os.lstat etc.


Follow-Ups:

Date: 2000-Aug-29 21:51
By: fdrake

Comment:
We could add an additional element to the end with the st_rdev value, but I'm not convinced that's really the right approach; some other platform that defines another field could get that added at the end of the return tuple, and the the 11th position would have incompatible values.

The "right" solution may be to create a new function (nstat?) that returns either a dictionary or other object that has entries for all the fields (using None for fields a platform doesn't provide values for).
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=111481&group_id=5470