Skip to content

Instantly share code, notes, and snippets.

@krisarmstrong
Created April 1, 2015 15:48
Show Gist options
  • Select an option

  • Save krisarmstrong/d89a62a9b90e627fec25 to your computer and use it in GitHub Desktop.

Select an option

Save krisarmstrong/d89a62a9b90e627fec25 to your computer and use it in GitHub Desktop.
Determines if a directory is a mount point for a drive Linux
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