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.statvfs() method in Python is used to get the information about the mounted file system containing the given path. To get file system information the method performs statvfs() system call on the given path.
os.statvfs() method is available on Unix platforms only.
path: A path-like object for which file system information is required.
Return Type: This method returns an object of class ‘os.statvfs_result’ whose attributes represents the information about the file system containing the given path.
The returned os.statvfs_result object has following attributes:
- f_bsize: It represents the file system block size
- f_frsize: It represents the fragment size
- f_blocks It represents the size of fs in f_frsize units
- f_bfree: It represents the number of free blocks
- f_bavail: It represents the number of free blocks for unprivileged users
- f_files: It represents the number of inodes
- f_ffree: It represents the number of free inodes
- f_favail: It represents the number of free inodes for unprivileged users
- f_fsid: It represents the file system ID
- f_flag: It represents the mount flags
- f_namemax: It represents the maximum filename length
os.statvfs_result(f_bsize=4096, f_frsize=4096, f_blocks=59798433, f_bfree=56521834, f_bavail=53466807, f_files=15261696, f_ffree=14933520, f_favail=14933520, f_flag=4096, f_namemax=255) File system block size: 4096 Number of free blocks: 56517297
- class method vs static method in Python
- Difference between Method Overloading and Method Overriding in Python
- Get() method for dictionaries in Python
- Real-Time Edge Detection using OpenCV in Python | Canny edge detection method
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Line detection in python with OpenCV | Houghline method
- Python | os._exit() method
- Python | os.WEXITSTATUS() method
- Python | os.abort() method
- Python | os.renames() method
- Python | os.lseek() method
- Python calendar module | formatmonth() method
- Python | PyTorch sin() method
- Python | Sympy Line.is_parallel() method
- Python PIL | GaussianBlur() method
- Python | range() method
- Python | Numpy np.hermefit() method
- Python | Numpy np.hermevander() method
- Python String Title method
- Python groupby method to remove all consecutive duplicates
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.