Search code examples
pythonwindowsntfs

Determine if a file is on an NTFS filesystem


Is there a Windows API for determining if a certain file (path) is on an NTFS filesystem?

If this can be somehow inferred from an existing Python API, all the better.


Solution

  • Dont know how to do it in Python, but I assume that invoking C functions will be easy.

    So in C open file handle bu CreateFile, you'll retrieve a handle to such file. Then call GetVolumeInformationByHandleW and check the lpFileSystemNameBuffer variable for "ntfs" string.