# xarray.backends.CachingFileManager.acquire_context

#### CachingFileManager.acquire_context(needs_lock=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/backends/file_manager.py#L257-L272)

Context manager for acquiring a file.

The file stays open until the context exits, even if it is evicted
from the cache in the meantime.
