Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python os.statvfs() method

Python os.statvfs() method

Python File methods Python OS file/directory methods


Overview

The os.statvfs() method returns information about the file system of the file containing the file descriptor fd.

Syntax

The **statvfs()** method syntax is as follows:



os.statvfs([path])

Parameters

Return Value

The returned structure:

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)

Python File methods Python OS file/directory methods