示例#1
0
 def __init__(self, owner, path, flags):
     super(SFTPHandle, self).__init__(flags)
     mode = flags_to_mode(flags)
     self.owner = owner
     if not isinstance(path, unicode):
         path = path.decode(self.owner.encoding)
     self.path = path
     self._file = owner.fs.open(path, mode)
示例#2
0
 def __init__(self, owner, path, flags):
     super(SFTPHandle, self).__init__(flags)
     mode = flags_to_mode(flags) + "b"
     self.owner = owner
     if not isinstance(path, unicode):
         path = path.decode(self.owner.encoding)
     self.path = path
     self._file = owner.fs.open(path, mode)
示例#3
0
 def create(self, path, mode, fi):
     path = path.decode(NATIVE_ENCODING)
     # FUSE doesn't seem to pass correct mode information here - at least,
     # I haven't figured out how to distinguish between "w" and "w+".
     # Go with the most permissive option.
     mode = flags_to_mode(fi.flags)
     fh = self._reg_file(self.fs.open(path, mode), path)
     fi.fh = fh
     fi.keep_cache = 0
 def create(self, path, mode, fi):
     path = path.decode(NATIVE_ENCODING)
     # FUSE doesn't seem to pass correct mode information here - at least,
     # I haven't figured out how to distinguish between "w" and "w+".
     # Go with the most permissive option.
     mode = flags_to_mode(fi.flags)
     fh = self._reg_file(self.fs.open(path, mode), path)
     fi.fh = fh
     fi.keep_cache = 0
示例#5
0
 def open(self, path, flags):
     mode = flags_to_mode(flags)
     return self._reg_file(self.fs.open(path, mode))
示例#6
0
 def open(self, path, fi):
     path = path.decode(NATIVE_ENCODING)
     mode = flags_to_mode(fi.flags)
     fi.fh = self._reg_file(self.fs.open(path,mode),path)
     fi.keep_cache = 0
     return 0
示例#7
0
 def open(self, path, fi):
     path = path.decode(NATIVE_ENCODING)
     mode = flags_to_mode(fi.flags)
     fi.fh = self._reg_file(self.fs.open(path, mode), path)
     fi.keep_cache = 0
     return 0
示例#8
0
 def open(self,path,flags):
     mode = flags_to_mode(flags)
     return self._reg_file(self.fs.open(path,mode))
示例#9
0
 def __init__(self,owner,path,flags):
     super(SFTPHandle,self).__init__(flags)
     mode = flags_to_mode(flags)
     self.owner = owner
     self.path = path
     self._file = owner.fs.open(path,mode)