YouTip LogoYouTip

Os Statvfs

# Python2.x Python os.statvfs() Method [![Image 3: Python File Methods](#) Python OS File/Directory Methods](#) * * * ### Overview The os.statvfs() method is used to return information about the file system containing the file specified by path. ### Syntax The **statvfs()** method syntax format is as follows: os.statvfs() ### Parameters * **path** -- File path. ### Return Value Returned structure: * **f_bsize:** File system block size * **f_frsize:** Fragment size * **f_blocks:** Total number of data blocks in the file system * **f_bfree:** Number of free blocks * **f_bavail:** Number of free blocks available to non-superuser * **f_files:** Total number of file nodes * **f_ffree:** Number of free file nodes * **f_favail:** Number of free file nodes available to non-superuser * **f_fsid:** File system ID * **f_flag:** Mount flags * **f_namemax:** Maximum file name length ### Example The following example demonstrates the use of the statvfs() method: #!/usr/bin/python# -*- coding: UTF-8 -*-import os, sys # Display statvfs information for "a1.py" file stinfo = os.statvfs('a1.py')print stinfo The output of the above program is: 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) [![Image 4: Python File Methods](#) Python OS File/Directory Methods](#)
← Os TcgetpgrpOs Stat β†’