6

I'm looking for a way in python to find out which type of file system is being used for a given path. I'm wanting to do this in a cross platform way. On linux I could just grab the output of df -T but that won't work on OSX or windows.

3 Answers 3

1

Take the hint -- different platforms are actually different.

Use lsvfs on Mac OS X and those Linux that support it.

Use this on Windows.

Use an if-statement to decide.

Sign up to request clarification or add additional context in comments.

Comments

-1

This is the Windows API you might want to call. This should be a good start for the OS X api you are looking for, instead.

Comments

-2

os.popen('/sbin/fdisk -l /dev/sda') on Linux

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.