OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.minor() method in Python is used to extract the device minor number from the specified raw device number (Usually the value of st_dev or st_rdev attribute of ‘os.stat_result’ object returned by os.stat() method). .
In Unix, everything is file, some are ordinary files while some are special files. Special files can be found under /dev directory. These special files are called device files. Character and block devices are the most common type of device files. These device files are represented as a pair of numbers ( major device number and minor device number) by Linux kernel.
Major device number indicates that which driver is used to access the hardware. Each driver in the system has a unique major number and all the device files whose major device number is same is controlled by the same driver.
While minor device number is used by the driver to distinguish between the various hardware it controls. Minor device number tells the kernel special characteristics of the device to be accessed.
Note: This method is available only on UNIX platforms.
device: An integer value representing the raw device number
Return Type: This method returns an integer value which represents the device minor number.
Raw device number: 2056 Device minor number: 8
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Python | next() method
- Python | os.dup() method
- Python | set() method
- Python PIL | Image.new() method
- Python - PyTorch abs() method
- Method Overriding in Python
- Python - PyTorch exp() method
- Python | os.getsid() method
- Python - PyTorch add() method
- Python | os.makedev() method
- Python | os.setregid() method
- turtle.up() method in Python
- Python | os.rename() method
- Python | os.fdatasync() method
- Python | os.sync() method
- Python | os.pipe2() method
- Python | os.sendfile() method
- turtle.down() method in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.