How to compose a raw device number from the major and minor device numbers?
Answers
Answered by
1
import os, sys
path = "/var/www/html/foo.txt"
# Get the stat tuple
info = os.lstat(path)
# Get major and minor device number
major_dnum = os.major(info.st_dev)
minor_dnum = os.minor(info.st_dev)
dev_num = os.makedev(major_dnum, minor_dnum)
print "Device Number :", dev_num
This will give the output:
jinalmarkana:
hi
Similar questions
Physics,
7 months ago
Science,
7 months ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago