Skip to content

Reword OpenOptions::{create, create_new} doc. #69284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,7 @@ impl OpenOptions {
self
}

/// Sets the option for creating a new file.
///
/// This option indicates whether a new file will be created if the file
/// does not yet already exist.
/// Sets the option to create a new file, or open it if it already exists.
///
/// In order for the file to be created, [`write`] or [`append`] access must
/// be used.
Expand All @@ -868,11 +865,10 @@ impl OpenOptions {
self
}

/// Sets the option to always create a new file.
/// Sets the option to create a new file, failing if it already exists.
///
/// This option indicates whether a new file will be created.
/// No file is allowed to exist at the target location, also no (dangling)
/// symlink.
/// No file is allowed to exist at the target location, also no (dangling) symlink. In this
/// way, if the call succeeds, the file returned is guaranteed to be new.
///
/// This option is useful because it is atomic. Otherwise between checking
/// whether a file exists and creating a new one, the file may have been
Expand Down