Message6679

Author amak
Recipients amak, dstromberg, irmen
Date 2011-10-15.11:51:51
SpamBayes Score 6.214196e-11
Marked as misclassified No
Message-id <1318679511.82.0.107771689599.issue1737@psf.upfronthosting.co.za>
In-reply-to
Content
Note that this information is not available from standard java.

Jython, because it has posix support, does provide access to the device number, in the st_dev field of the tuple returned from os.stat.

>>> import os
>>> st = os.stat('.')
>>> print st
(16895, 0L, 23L, 1, 0, 0, 0L, 1318677370, 1318677370, 1318677217)
>>> import stat
>>> device_number = st[stat.ST_DEV]
>>> print device_number
23L

However, extracting a major and minor device number from that device number is platform-dependent, AFAIK, meaning that the major and minor device numbers will appear in different bit positions in that device number, on different platforms.

Implementing platform-specific versions of the major and minor functions for each platform has yet been implemented on jython.

Patches welcome.
History
Date User Action Args
2011-10-15 11:51:51amaksetmessageid: <1318679511.82.0.107771689599.issue1737@psf.upfronthosting.co.za>
2011-10-15 11:51:51amaksetrecipients: + amak, irmen, dstromberg
2011-10-15 11:51:51amaklinkissue1737 messages
2011-10-15 11:51:51amakcreate