Python os.minor() Method
Example
Print the device minor number:
#Import os Library
import os
# Get the raw device number
device = os.stat("file.txt").st_dev
# Print the device minor number
print("Minor Device Number:", os.minor(device))
Definition and Usage
The os.minor() returns the device minor number from raw device number.
Raw device number is usually st_dev or st_rdev field from stat.
st_dev identifies the device on which the file resides and st_rdev
represent type of device.
Syntax
os.minor(device)
Parameter Values
| Parameter | Description |
|---|---|
| device | Required. Specifies the raw device number |
Technical Details
| Return Value: | An int value representing the device minor number.
|
|---|---|
| Python Version: | 2.3 |