Esempio n. 1
0
 def mknod(self, tfid, path, mode, dev):
     if dev != 0:
         return -errno.ENOSYS
     # FIXME
     if not mode & stat.S_IFREG:
         mode |= stat.S_IFDIR
     try:
         self.client._walk(self.client.ROOT,
                 tfid, filter(None, path.split("/")))
         self.client._open(tfid, py9p.OTRUNC)
         self.client._clunk(tfid)
     except py9p.RpcError as e:
         if e.message == "file not found":
                 self.client._walk(self.client.ROOT,
                         tfid, filter(None, path.split("/"))[:-1])
                 self.client._create(tfid,
                         filter(None, path.split("/"))[-1],
                         py9p.mode2plan(mode), 0)
                 self.client._clunk(tfid)
         else:
             return -errno.EIO
Esempio n. 2
0
 def chmod(self, path, mode):
     return self._wstat(path, mode=py9p.mode2plan(mode))