# xarray.backends.CachingFileManager.acquire

`CachingFileManager.``acquire`(needs_lock=True)

  Acquire a file object from the manager.

  A new file is only opened if it has expired from the least-recently-used cache.

  This method uses a lock, which ensures that it is thread-safe. You can safely acquire a file in multiple threads at the same time, as long as the underlying file object is thread-safe.

  Returns: |
  Return type: | An open file object, as returned by `opener(*args, **kwargs)`.