當前位置: 首頁>>代碼示例>>Python>>正文


Python path.ismount方法代碼示例

本文整理匯總了Python中os.path.ismount方法的典型用法代碼示例。如果您正苦於以下問題:Python path.ismount方法的具體用法?Python path.ismount怎麽用?Python path.ismount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在os.path的用法示例。


在下文中一共展示了path.ismount方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: find_mount_point

# 需要導入模塊: from os import path [as 別名]
# 或者: from os.path import ismount [as 別名]
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 
開發者ID:liorbenhorin,項目名稱:pipeline,代碼行數:9,代碼來源:plat_other.py

示例2: ismount

# 需要導入模塊: from os import path [as 別名]
# 或者: from os.path import ismount [as 別名]
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) 
開發者ID:wonderworks-software,項目名稱:PyFlow,代碼行數:5,代碼來源:PathLib.py

示例3: _check_for_directory

# 需要導入模塊: from os import path [as 別名]
# 或者: from os.path import ismount [as 別名]
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 
開發者ID:hitchtest,項目名稱:hitch,代碼行數:16,代碼來源:hitchdir.py


注:本文中的os.path.ismount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。