Well, in my previous answer, I thought you needed windows, however, I believe I found a way on Linux.
Try the following:
Using the subprocess of this command df -T /users/f/foo/file.txt , you can get the desired results.
import subprocess p = subprocess.Popen(["df -T %s"] % path, stdout=subprocess.PIPE) out, err = p.communicate()
Output Example:
Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda5 ext4 472439072 146088944 302351616 33% /
source share