def create(self, path, flags, mode): # {{{3
    try:
      self.__log_call('create', 'create(%r, %o, %o)', path, flags, mode)
      if self.read_only: return -errno.EROFS
      try:
        # If the file already exists, just open it.
        status = self.open(path, flags, nested=True)
      except __HOLE__, e:
        if e.errno != errno.ENOENT: raise
        # Otherwise create a new file and open that.
        inode, parent_ino = self.__insert(path, mode, 0)
        status = self.open(path, flags, nested=True, inode=inode)
      self.__commit_changes()
      self.__gc_hook()
      return status
    except Exception, e:
      self.__rollback_changes()
      return self.__except_to_status('create', e, errno.EIO)
dataset/ETHPy150Open xolox/dedupfs/dedupfs.py/DedupFS.create