def __init__(self, root, cmd_channel, ftproot, cwd, readonly=False): #_Base.__init__(self, root, cmd_channel) AbstractedFS.__init__(self, root, cmd_channel) self.cwd = cwd self.cwdftp = "" self.ftproot = ftproot self.readonly = readonly
def open(self, filename, mode): from errno import EISDIR from os import strerror if filename is ShareRoot: raise IOError(EISDIR, strerror(EISDIR)) else: return AbstractedFS.open(self, filename, mode)
def __init__(self, root, cmd_channel): AbstractedFS.__init__(self, root, cmd_channel) self.cwd = root self.type = cmd_channel.type self.s3_bucket = cmd_channel.s3_bucket self.aws_access_key = cmd_channel.aws_access_key self.aws_secret_key = cmd_channel.aws_secret_key self.seperator = cmd_channel.seperator self.thread_synchronize = cmd_channel.thread_synchronize self.key_sync_timeout = cmd_channel.key_sync_timeout if not self.cmd_channel.fs_obj: if self.type == "memory": self.fs_obj = MemoryFS() elif self.type == "s3": self.fs_obj = S3FS(bucket=self.bucket, prefix=self.prefix, aws_access_key=self.aws_access_key, aws_secret_key=self.aws_secret_key, separator=self.seperator, thread_synchronize=self.thread_synchronize, key_sync_timeout=self.key_sync_timeout) self.cmd_channel.fs_obj = self.fs_obj else: self.fs_obj = self.cmd_channel.fs_obj
def __init__(self, root, cmd_channel): AbstractedFS.__init__(self, root, cmd_channel) # initial cwd was set to "/" to emulate a chroot jail self.cwd = root
def __init__(self, root, cmd_channel, list): AbstractedFS.__init__(self, root, cmd_channel) self.cwd = root self.list = list
def chdir(self, path): if path is ShareRoot: self.cwd = "/" return else: return AbstractedFS.chdir(self, path)
def isfile(self, path): #pdb.set_trace() if path is ShareRoot: return False else: return AbstractedFS.isfile(self, path)
def realpath(self, path): if path in (ShareRoot, InvalidPath): return path else: return AbstractedFS.realpath(self, path)
def __init__(self): AbstractedFS.__init__(self)
def joinpath(self, head, tail): if head is ShareRoot: return self.shares[tail] else: return AbstractedFS.joinpath(self, head, tail)
def listdir(self, path): if path is ShareRoot: return self.shares.keys() else: return AbstractedFS.listdir(self, path)
def isdir(self, path): if path is ShareRoot: return True else: return AbstractedFS.isdir(self, path)