
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Variable Types
- Python - Basic 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
- Python Advanced Tutorial
- Python - Classes/Objects
- Python - Reg Expressions
- Python - CGI Programming
- Python - Database Access
- Python - Networking
- Python - Sending Email
- Python - Multithreading
- Python - XML Processing
- Python - GUI Programming
- Python - Further Extensions
- Python Useful Resources
- Python - Questions and Answers
- Python - Quick Guide
- Python - Tools/Utilities
- Python - Useful Resources
- Python - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python os.statvfs() Method
Description
Python method statvfs() perform a statvfs system call on the given path.
Syntax
Following is the syntax for statvfs() method −
os.statvfs(path)
Parameters
path − This is the path, whose statvfs information is required.
Return Value
Here is the list of members of statvfs structure −
f_bsize − preferred file system block size.
f_frsize − fundamental file system block size.
f_blocks − total number of blocks in the filesystem.
f_bfree − total number of free blocks.
f_bavail − free blocks available to non-super user.
f_files − total number of file nodes.
f_ffree − total number of free file nodes.
f_favail − free nodes available to non-super user.
f_flag − system dependent.
f_namemax − maximum file name length.
Example
The following example shows the usage of statvfs() method.
# !/usr/bin/python import os, sys # showing statvfs information of file "a1.py" stinfo = os.statvfs('a1.py') print stinfo
When we run above program, it produces following result −
posix.statvfs_result(f_bsize=4096, f_frsize=4096, f_blocks=1909350L, f_bfree=1491513L, f_bavail=1394521L, f_files=971520L, f_ffree=883302L, f_fvail=883302L, f_flag=0, f_namemax=255)