本文整理匯總了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