Skip to content

Commit 1440716

Browse files
committed
Tone down the wording of the paragraph
* replace the "less useful" remark with the text proposed by @m-ou-se * remove the last sentence "unless data consists of single byte", which wasn't really necessary
1 parent f50d327 commit 1440716

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/std/src/fs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -977,12 +977,12 @@ impl OpenOptions {
977977
/// has a race between seeking and writing during which another writer can write, with
978978
/// our `write()` overwriting their data.
979979
///
980-
/// Keep in mind that atomicity of `write()` in append mode is less useful than it
981-
/// appears at first. A successful `write()` is allowed to write only part of the
982-
/// given data, so even if you're careful to provide the whole message in a single
983-
/// call to `write()`, there is no guarantee that it will written out in full. Unless
984-
/// the data to append consists of a single byte, you can't append atomically without
985-
/// external locking.
980+
/// Keep in mind that this does not necessarily guarantee that data appended by
981+
/// different processes or threads does not interleave. The amount of data accepted a
982+
/// single `write()` call depends on the operating system and file system. A
983+
/// successful `write()` is allowed to write only part of the given data, so even if
984+
/// you're careful to provide the whole message in a single call to `write()`, there
985+
/// is no guarantee that it will written out in full.
986986
///
987987
/// If a file is opened with both read and append access, beware that after
988988
/// opening, and after every write, the position for reading may be set at the

0 commit comments

Comments
 (0)