本文整理汇总了Python中connector.Connector.getDents方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.getDents方法的具体用法?Python Connector.getDents怎么用?Python Connector.getDents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connector.Connector
的用法示例。
在下文中一共展示了Connector.getDents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CloudFS
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import getDents [as 别名]
#.........这里部分代码省略.........
if paths[0] == None:
raise FuseOSError(ENOENT)
# search available file
fd = None
fdNum = -1
for i in range(0, self.maxFiles):
fd = self.files[i]
if fd['path'] == None:
fdNum = i
break
if fd == None:
raise FuseOSError(ENOENT)
fd['path'] = path
fd['dirty'] = False
fd['data'] = content
return fdNum
def read(self, path, size, offset, fh):
if self.files[fh]['path'] == None:
raise FuseOSError(ENOENT)
return self.files[fh]['data'][offset:offset + size]
def readdir(self, path, fh):
paths = splitPath(path)
if paths[0] == '':
dents = self.conn.getConns()
else:
dents = self.conn.getDents(paths[0], paths[1])
return ['.', '..'] + dents
def readlink(self, path):
# readlink is not allowed
raise FuseOSError(EPERM)
def removexattr(self, path, name):
raise FuseOSError(EPERM)
def rename(self, old, new):
# rename is not allowed
raise FuseOSError(EPERM)
def rmdir(self, path):
paths = splitPath(path)
# cannot remove mounted dir
if paths[1] == '':
raise FuseOSError(EPERM)
if self.conn.rm(paths[0], paths[1]) != True:
raise FuseOSError(ENOENT)
def setxattr(self, path, name, value, options, position=0):
raise FuseOSError(EPERM)
def statfs(self, path):
raise FuseOSError(EPERM)
def symlink(self, target, source):
raise FuseOSError(EPERM)