
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to compose a raw device number from the major and minor device numbers?
The method os.makedev(major, minor) composes a raw device number from the major and minor device numbers.
For example
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
Output
This will give the output:
Device Number : 105
- Related Articles
- How to get the device major number from a raw device number using Python?
- How to find Serial number of Android device?
- How to check if a bluetooth device is connected with Android device?
- How to eject the USB device from the system using PowerShell?
- How to get number of Sims available in android device?
- How to check if a bluetooth device is connected with an Android device using Kotlin?
- How to lock the Android device programmatically?
- How to find the serial number of an Android device using Kotlin?
- How to detect a mobile device with JavaScript?
- How to independently set horizontal and vertical, major and minor gridlines of a plot?
- How to lock & unlock the iOS device programmatically
- Mnemonic Device
- How to get device make and model on iOS?
- How to get and store Device ID in Android?
- How to access unique Android device ID?

Advertisements