[Python-Dev] os.stat(filename).r_dev
Martin v. Loewis
martin@v.loewis.de
09 Jun 2002 22:46:26 +0200
Gustavo Niemeyer <niemeyer@conectiva.com> writes:
> It seems like we really need some way to decode r_dev. One possible
> solutions are to implement major(), minor(), and makedev() somewhere.
> Another solution, if r_dev's raw value has no obvious use, would be to
> turn it into a two elements tuple like (major, minor).
>
> Any suggestions?
I'd add a field r_dev_pair which splits this into major and minor. I
would not remove r_dev, since existing code may break.
Notice that major, minor, and makedev is already available through
TYPES on many platforms, although this has the known limitations, and
is probably wrong for Linux at the moment.
Regards,
Martin