Skip to content

Commit 5ac1500

Browse files
authored
Write prose for "exclusive" feature (#1762)
1 parent 212ffb1 commit 5ac1500

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/source/features.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,21 @@ tqdm.
408408

409409
<script data-goatcounter="https://fsspec.goatcounter.com/count"
410410
async src="//gc.zgo.at/count.js"></script>
411+
412+
413+
Exclusive write
414+
---------------
415+
416+
Some backends support writing to a file only if it doesn't already exist. This may be
417+
implemented for the following methods:
418+
- pipe_file (with argument ``mode=='create'``)
419+
- put_file (with argument ``mode=='create'``)
420+
- open (with argument ``mode="xb"``)
421+
Since some writes will be achieved in blocks, the timing of when the check is done is
422+
not defined - it may be at the start or at the completion of the operation, depending
423+
on the backend.
424+
425+
If using exclusive mode on a file that does already exist, a ``FileExistsError`` will
426+
be raised.
427+
428+
This feature is currently included on a trial basis and may change in the future.

0 commit comments

Comments
 (0)