# uproot.reading.DetachedFile

Defined in [uproot.reading](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/reading.py) on [line 451](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/reading.py#L451).

| **Inheritance order:**                                                             |
|------------------------------------------------------------------------------------|
| 1. [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md) |

### *class* uproot.reading.DetachedFile(file)

* **Parameters:**
  **file** ([uproot.ReadOnlyFile](uproot.reading.ReadOnlyFile.html.md)) – The active file object to
  convert into a detached file.

A placeholder for a [uproot.ReadOnlyFile](uproot.reading.ReadOnlyFile.html.md) with useful
information, such as the [file_path](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-file-path)
used in many error messages, without holding a reference to the active
[uproot.source.chunk.Source](uproot.source.chunk.Source.html.md).

This allows the file to be closed and deleted while objects that were read
from it still exist. Also, only objects that hold detached file references,
rather than active ones, can be pickled.

The (unpickleable) objects that must hold a reference to an active
[uproot.ReadOnlyFile](uproot.reading.ReadOnlyFile.html.md) are listed by C++ (decoded) classname
in `uproot.must_be_attached`.

<a id="uproot-reading-detachedfile-file-path"></a>

## file_path

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.file_path

The original path to the file (converted to `str` if it was originally
a `pathlib.Path`).

<a id="uproot-reading-detachedfile-options"></a>

## options

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.options

The dict of `options` originally passed to the file constructor.

If this is a [uproot.WritableFile](uproot.writing.writable.WritableFile.html.md), the `options` are a copy
of the current state of the options; change the properties (e.g.
`initial_directory_bytes`, `uuid_function`) directly on the file object
to make a lasting change. Modifying the copied dict does not change the
file’s future behavior.

<a id="uproot-reading-detachedfile-root-version"></a>

## root_version

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.root_version

Version of ROOT used to write the file as a string.

See [root_version_tuple](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-root-version-tuple) and
[fVersion](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-fversion).

<a id="uproot-reading-detachedfile-root-version-tuple"></a>

## root_version_tuple

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.root_version_tuple

Version of ROOT used to write teh file as a tuple.

See [root_version](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-root-version) and
[fVersion](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-fversion).

<a id="uproot-reading-detachedfile-is-64bit"></a>

## is_64bit

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.is_64bit

True if the ROOT file is 64-bit ready; False otherwise.

A file that is larger than 4 GiB must be 64-bit ready, though any file
might be. This refers to seek points like
[fSeekFree](uproot.reading.ReadOnlyFile.html.md#uproot-reading-readonlyfile-fseekfree) being 64-bit integers,
rather than 32-bit.

Note that a file being 64-bit is distinct from a `TDirectory` being
64-bit; see [is_64bit](uproot.reading.ReadOnlyDirectory.html.md#uproot-reading-readonlydirectory-is-64bit).

<a id="uproot-reading-detachedfile-compression"></a>

## compression

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.compression

A [uproot.compression.Compression](uproot.compression.Compression.html.md) object describing the
compression setting for the ROOT file.

Note that different objects (even different `TBranches` within a
`TTree`) can be compressed differently, so this file-level
compression is only a strong hint of how the objects are likely to
be compressed.

For some versions of ROOT `TStreamerInfo` is always compressed with
[uproot.ZLIB](uproot.compression.ZLIB.html.md), even if the compression is set to a
different algorithm.

See [fCompress](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-fcompress).

<a id="uproot-reading-detachedfile-hex-uuid"></a>

## hex_uuid

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.hex_uuid

The unique identifier (UUID) of the ROOT file expressed as a hexadecimal
string.

See [uuid](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-uuid) and
[fUUID](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-fuuid).

<a id="uproot-reading-detachedfile-uuid"></a>

## uuid

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.uuid

The unique identifier (UUID) of the ROOT file expressed as a Python
`uuid.UUID` object.

See [hex_uuid](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-hex-uuid) and
[fUUID](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-fuuid).

<a id="uproot-reading-detachedfile-fversion"></a>

## fVersion

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fVersion

Raw version information for the ROOT file; this number is used to derive
[root_version](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-root-version),
[root_version_tuple](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-root-version-tuple), and
[is_64bit](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-is-64bit).

<a id="uproot-reading-detachedfile-fbegin"></a>

## fBEGIN

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fBEGIN

The seek point (int) for the first data record, past the TFile header.

Usually 100.

<a id="uproot-reading-detachedfile-fend"></a>

## fEND

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fEND

The seek point (int) to the last free word at the end of the ROOT file.

<a id="uproot-reading-detachedfile-fseekfree"></a>

## fSeekFree

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fSeekFree

The seek point (int) to the `TFree` data, for managing empty spaces
in a ROOT file (filesystem-like fragmentation).

<a id="uproot-reading-detachedfile-fnbytesfree"></a>

## fNbytesFree

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fNbytesFree

The number of bytes in the `TFree` data, for managing empty spaces
in a ROOT file (filesystem-like fragmentation).

<a id="uproot-reading-detachedfile-nfree"></a>

## nfree

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.nfree

The number of objects in the `TFree` data, for managing empty spaces
in a ROOT file (filesystem-like fragmentation).

<a id="uproot-reading-detachedfile-fnbytesname"></a>

## fNbytesName

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fNbytesName

The number of bytes in the filename (`TNamed`) that is embedded in
the ROOT file.

<a id="uproot-reading-detachedfile-funits"></a>

## fUnits

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fUnits

Number of bytes in the serialization of file seek points, which can either
be 4 or 8.

<a id="uproot-reading-detachedfile-fcompress"></a>

## fCompress

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fCompress

The raw integer describing the compression setting for the ROOT file.

Note that different objects (even different `TBranches` within a
`TTree`) can be compressed differently, so this file-level
compression is only a strong hint of how the objects are likely to
be compressed.

For some versions of ROOT `TStreamerInfo` is always compressed with
[uproot.ZLIB](uproot.compression.ZLIB.html.md), even if the compression is set to a
different algorithm.

See [compression](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-compression).

<a id="uproot-reading-detachedfile-fseekinfo"></a>

## fSeekInfo

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fSeekInfo

The seek point (int) to the `TStreamerInfo` data, where
[streamers](uproot.reading.ReadOnlyFile.html.md#uproot-reading-readonlyfile-streamers) are located.

<a id="uproot-reading-detachedfile-fnbytesinfo"></a>

## fNbytesInfo

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fNbytesInfo

The number of bytes in the `TStreamerInfo` data, where
[streamers](uproot.reading.ReadOnlyFile.html.md#uproot-reading-readonlyfile-streamers) are located.

<a id="uproot-reading-detachedfile-fuuid"></a>

## fUUID

Inherited from [uproot.reading.CommonFileMethods](uproot.reading.CommonFileMethods.html.md).

#### DetachedFile.fUUID

The unique identifier (UUID) of the ROOT file as a raw bytestring
(Python `bytes`).

See [hex_uuid](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-hex-uuid) and
[uuid](uproot.reading.CommonFileMethods.html.md#uproot-reading-commonfilemethods-uuid).
