code: def check_write(self, name):
          
          assert compat.is_native(name)
          if self.readonly and name not in (
              DirMetadata.META_FILE_NAME,
              DirMetadata.LOCK_FILE_NAME,
          ):
              raise RuntimeError("Target is read-only: {} + {} / ".format(self, name))
docs: Raise exception if writing cur_dir/name is not allowed.