本文整理汇总了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
示例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)
示例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