# uproot.recreate

Defined in [uproot.writing.writable](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/writing/writable.py) on [line 81](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/writing/writable.py#L81).

### uproot.writing.writable.recreate(file_path: str | Path | IO, \*\*options)

* **Parameters:**
  * **file_path** (str, `pathlib.Path` or file-like object) – The filesystem path of the
    file to open or an open file.
  * **options** – See below.

Opens a local file for writing. Like ROOT’s `"RECREATE"` option, this function
overwrites any file that already exists at `file_path`.

Returns a [uproot.WritableDirectory](uproot.writing.writable.WritableDirectory.html.md).

<!-- Future Dev Note: These shared writing options are manually copied across
multiple docstrings to make them available in `help` and online. -->

Options (type; default):

* initial_directory_bytes (int; 256): The number of bytes to allocate for new directories so that
  TKeys can be added to them without needing immediate rewriting of the block.
* initial_streamers_bytes (int; 1024): The number of bytes to allocate for a new list of streamers
  so that streamers can be added to it without needing immediate rewriting
* uuid_function (callable; `uuid.uuid1`): Function to create the file’s UUID and/or any directory’s UUID.
* compression ([uproot.compression.Compression](uproot.compression.Compression.html.md) or None; `uproot.ZLIB(1)`): Compression algorithm
  and level for new objects added to the file. Can be updated after creating
  the [uproot.WritableFile](uproot.writing.writable.WritableFile.html.md).

See [uproot.WritableFile](uproot.writing.writable.WritableFile.html.md) for details on these options.

Additional options are passed as `storage_options` to the fsspec filesystem
