You are here : python_2ososstat

os.stat() - os

             

The method stat() performs a stat system call on the given path.


  • path -- This is the path, whose stat information is required.


Syntax


os.stat(path)


Example


# !/usr/bin/python

import os, sys

# showing stat information of file "a2.py"
statinfo = os.stat('a2.py')

print statinfo


Output / Return Value

When we run above program, it produces following result:


posix.stat_result(st_mode=33188, st_ino=3940649674337682L, st_dev=277923425L, st _nlink=1, st_uid=400, st_gid=401, st_size=335L, st_atime=1330498089, st_mtime=13 30498089, st_ctime=1330498089)


Limitations


Alternatives / See Also


Reference