
- Python 3 Basic Tutorial
- Python 3 - Home
- What is New in Python 3
- Python 3 - Overview
- Python 3 - Environment Setup
- Python 3 - Basic Syntax
- Python 3 - Variable Types
- Python 3 - Basic Operators
- Python 3 - Decision Making
- Python 3 - Loops
- Python 3 - Numbers
- Python 3 - Strings
- Python 3 - Lists
- Python 3 - Tuples
- Python 3 - Dictionary
- Python 3 - Date & Time
- Python 3 - Functions
- Python 3 - Modules
- Python 3 - Files I/O
- Python 3 - Exceptions
- Python 3 Advanced Tutorial
- Python 3 - Classes/Objects
- Python 3 - Reg Expressions
- Python 3 - CGI Programming
- Python 3 - Database Access
- Python 3 - Networking
- Python 3 - Sending Email
- Python 3 - Multithreading
- Python 3 - XML Processing
- Python 3 - GUI Programming
- Python 3 - Further Extensions
- Python 3 Useful Resources
- Python 3 - Questions and Answers
- Python 3 - Quick Guide
- Python 3 - Tools/Utilities
- Python 3 - Useful Resources
- Python 3 - 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 3 - os.statvfs() Method
Description
The 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. Availabe on Unix like systems.
# !/usr/bin/python3 import os, sys # showing statvfs information of file "a1.py" stinfo = os.statvfs('a1.py') print (stinfo)
Result
When we run the above program, it produces the 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)