A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025224.html below:

[Python-Dev] os.stat(filename).r_dev

[Python-Dev] os.stat(filename).r_devGustavo Niemeyer niemeyer@conectiva.com
Sun, 9 Jun 2002 18:17:11 -0300
Hi Martin!

First, some self-corrections.. :-)

> > It seems like we really need some way to decode r_dev. One possible
> > solutions are to implement major(), minor(), and makedev() somewhere.

"solution is"

> > Another solution, if r_dev's raw value has no obvious use, would be to

This should be st_rdev.

> > turn it into a two elements tuple like (major, minor).

> 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.

Isn't st_rdev being made available only in 2.3, trough stat attributes?

> 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.

Indeed. Here's what's defined here:

def major(dev): return ((int)(((dev) >> 8) & 0xff))
def minor(dev): return ((int)((dev) & 0xff))
def major(dev): return (((dev).__val[1] >> 8) & 0xff)
def minor(dev): return ((dev).__val[1] & 0xff)
def major(dev): return (((dev).__val[0] >> 8) & 0xff)
def minor(dev): return ((dev).__val[0] & 0xff)

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4