def access(self, path: str, name_or_id: Union[int, str] = None, required_perms: str = None): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.access(_path, name_or_id, required_perms)
def chown(self, fs_path: str, uid: int, gid: int, recursive: Optional[bool] = False): _fs, _path = self.delegate_path(fs_path) with unwrap_errors(fs_path): return _fs.chown(_path, uid, gid, recursive)
def get_permissions(self, path): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.get_permissions(_path)
def getinfo(self, path: str, get_actual: bool = False, namespaces=None): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.getinfo(_path, get_actual=get_actual, namespaces=namespaces)
def format_list(self, basedir, listing): _fs, _path = self.delegate_path(basedir) with unwrap_errors(basedir): return _fs.format_list(_path, listing)
def remove(self, path): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.remove(_path)
def _open(self, name, mode): with unwrap_errors(name): f = self.fs.open(name, mode) return File(f)
def _save(self, name, content): with unwrap_errors(name): self.fs.makedirs(dirname(name), recreate=True) self.fs.setbinfile(name, content) return name
def size(self, name): with unwrap_errors(name): size = self.fs.getsize(name) return size
def url(self, name): with unwrap_errors(name): ret = self.base_url + abspath(name) return ret
def delete(self, name): with unwrap_errors(name): try: self.fs.remove(name) except ResourceNotFoundError: pass
def removedir(self, path, rf=False): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.removedir(_path)
def getmtime(self, path): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.getmtime(_path)
def move(self, src_path, dst_path, overwrite=True): _fs, _src_path = self.delegate_path(src_path) _, _dst_path = self.delegate_path(dst_path) with unwrap_errors({_src_path: src_path, _dst_path: dst_path}): return _fs.move(_src_path, _dst_path, overwrite=overwrite)
def check_access(self, path=None, user=None, perms=None): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.check_access(_path, user, perms)
def chown(self, fs_path: str, uid: int, gid: int, recursive: Optional[bool]=False): _fs, _path = self.delegate_path(fs_path) with unwrap_errors(fs_path): return _fs.chown(_path, uid, gid, recursive)
def chmod(self, path: str, mode: oct, recursive: bool = False) -> None: _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.chmod(_path, mode, recursive)
def stat(self, path): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.stat(_path)
def access(self, path: str, name_or_id: Union[int, str]=None, required_perms: str=None): _fs, _path = self.delegate_path(path) with unwrap_errors(path): return _fs.access(_path, name_or_id, required_perms)