Web | This Site

Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# Python os.minor() Method

## Description:

This method extract the device minor number from a raw device number (usually the st_dev or st_rdev field from stat).

## Syntax:

    os.minor(device)

## Parameters:

Here is the detail of parameters:

- device: A raw device number (usually the st_dev or st_rdev field from stat).

## Example:

    #!/usr/bin/python

    import os, sys

    path = "/var/www/html/foo.txt"

    # Now get  the touple
    info = os.lstat(path)

    # Get major and minor device number
    major_dnum = os.major(info.st_dev)
    minor_dnum = os.minor(info.st_dev)

    print "Major Device Number :", major_dnum
    print "Minor Device Number :", minor_dnum

This would produce following result:

    Major Device Number : 0
    Minor Device Number : 103

Advertisement

Online Image Processing

Indian Baby Names