Created
April 1, 2015 15:48
-
-
Save krisarmstrong/d89a62a9b90e627fec25 to your computer and use it in GitHub Desktop.
Determines if a directory is a mount point for a drive Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def getmount(path): | |
| path = os.path.abspath(path) | |
| while path != os.path.sep: | |
| if os.path.ismount(path): | |
| return path | |
| path = os.path.abspath(os.path.join(path, os.pardir)) | |
| return path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment