Python os.fstatvfs() Method
Example
Get information about the filesystem of a descriptor :
# Import os Library
import os
# Open file
fd = os.open("test.txt", os.O_RDONLY)
# Get info about the file system of the file
print (os.fstatvfs(fd))
# Close file
os.close(fd)
Run Code »
Definition and Usage
The os.fstatvfs() method returns information about the file system of a file,
as a statvfs_result object.
Tip: This method is equal to os.statvfs(fd).
Note: Available only on UNIX platforms.
Syntax
os.fstatvfs(fd)
Parameter Values
| Parameter | Description |
|---|---|
| fd | Required. Represents a file descriptor |
Technical Details
| Return Value: | A statvfs_result object, representing the information about the file system
of the file:f_bsize - The file system block sizef_frsize - The fragment sizef_blocks - The size of fs in f_frsize unitsf_bfree - The number of free blocksf_bavail - The number of free blocks for
unprivileged usersf_files - The number of inodesf_ffree - The number of free inodesf_favail - The number of free inodes for
unprivileged usersf_fsid - The file system idf_flag - The mount flagsf_namemax - The maximum filename length |
|---|---|
| Python Version: | 2.6 |
| Change Log: | 3.3: This is equivalent to os.statvfs(fd) |