How to find the mountpoint a file resides on?
You may either call the mount command and parse its output to find the longest common prefix with your path, or use the stat system call to get the device a file resides on and go up the tree until you get to a different device. In Python, stat may be used as follows (untested … Read more