Skip to content

Commit

Permalink
Write prose for "exclusive" feature (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant authored Dec 11, 2024
1 parent 212ffb1 commit 5ac1500
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/source/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,21 @@ tqdm.

<script data-goatcounter="https://fsspec.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>


Exclusive write
---------------

Some backends support writing to a file only if it doesn't already exist. This may be
implemented for the following methods:
- pipe_file (with argument ``mode=='create'``)
- put_file (with argument ``mode=='create'``)
- open (with argument ``mode="xb"``)
Since some writes will be achieved in blocks, the timing of when the check is done is
not defined - it may be at the start or at the completion of the operation, depending
on the backend.

If using exclusive mode on a file that does already exist, a ``FileExistsError`` will
be raised.

This feature is currently included on a trial basis and may change in the future.

0 comments on commit 5ac1500

Please sign in to comment.