rename#

barecat.Index.rename(old, new, allow_overwrite=False)[source]#

Rename a file or directory in the index.

Parameters:
  • old (Union[barecat.core.types.BarecatEntryInfo, str]) – Path of the file or directory or the file or directory info object.

  • new (str) – New path.

  • allow_overwrite (bool) – if True and a file with path new already exists, then it is removed first. if False, an exception is raised.

Raises: