Python os.path.ismount() Examples

The following are 5 code examples of os.path.ismount(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module os.path , or try the search function .
Example #1
Source File: plat_other.py    From pipeline with MIT License 5 votes vote down vote up
def find_mount_point(path):
    # Even if something's wrong, "/" is a mount point, so the loop will exit.
    # Use realpath in case it's a symlink
    path = op.realpath(path) # Required to avoid infinite loop
    while not op.ismount(path):
        path = op.split(path)[0]
    return path 
Example #2
Source File: PathLib.py    From PyFlow with Apache License 2.0 5 votes vote down vote up
def ismount(path=("StringPin", "", {PinSpecifires.INPUT_WIDGET_VARIANT: "PathWidget"})):
        '''Return True if pathname path is a mount point: a point in a file system where a different file system has been mounted. The function checks whether path’s parent, path/.., is on a different device than path, or whether path/.. and path point to the same i-node on the same device — this should detect mount points for all Unix and POSIX variants.'''
        return osPath.ismount(path) 
Example #3
Source File: hitchdir.py    From hitch with GNU Affero General Public License v3.0 5 votes vote down vote up
def _check_for_directory():
    checkdirectory = os.getcwd()
    directories_checked = []
    hitch_directory = None

    while not ismount(checkdirectory):
        directories_checked.append(checkdirectory)
        if exists(join(checkdirectory, DOTDIR)):
            hitch_directory = join(checkdirectory, DOTDIR)
            break
        else:
            checkdirectory = abspath(join(checkdirectory, os.pardir))

    return hitch_directory, directories_checked 
Example #4
Source File: plat_other.py    From Snu-Photo-Manager with GNU Lesser General Public License v3.0 5 votes vote down vote up
def find_mount_point(path):
    # Even if something's wrong, "/" is a mount point, so the loop will exit.
    # Use realpath in case it's a symlink
    path = op.realpath(path) # Required to avoid infinite loop
    while not op.ismount(path):
        path = op.split(path)[0]
    return path 
Example #5
Source File: plat_other.py    From FileManager with MIT License 5 votes vote down vote up
def find_mount_point(path):
    # Even if something's wrong, "/" is a mount point, so the loop will exit.
    # Use realpath in case it's a symlink
    path = op.realpath(path) # Required to avoid infinite loop
    while not op.ismount(path):
        path = op.split(path)[0]
    return path