How to get filesystem in python.

Cameron Simpson cs at cskk.id.au
Fri Jan 17 16:17:59 EST 2020


On 17Jan2020 11:35, Antoon Pardon <antoon.pardon at vub.be> wrote:
>I would like to get the information given by the df command on linux/unix.
>I found the os.statvfs call, but it misses one thing: The filesystem.
>
>Does anyone know how to get that information.

If you os.stat() the same thing you statvfs()ed you get an st_dev field, 
which identifies the filesystem in principle. You still need to consult 
the system mount table to get a path to its root though.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list