File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -844,10 +844,7 @@ impl OpenOptions {
844
844
self
845
845
}
846
846
847
- /// Sets the option for creating a new file.
848
- ///
849
- /// This option indicates whether a new file will be created if the file
850
- /// does not yet already exist.
847
+ /// Sets the option to create a new file, or open it if it already exists.
851
848
///
852
849
/// In order for the file to be created, [`write`] or [`append`] access must
853
850
/// be used.
@@ -868,11 +865,10 @@ impl OpenOptions {
868
865
self
869
866
}
870
867
871
- /// Sets the option to always create a new file.
868
+ /// Sets the option to create a new file, failing if it already exists .
872
869
///
873
- /// This option indicates whether a new file will be created.
874
- /// No file is allowed to exist at the target location, also no (dangling)
875
- /// symlink.
870
+ /// No file is allowed to exist at the target location, also no (dangling) symlink. In this
871
+ /// way, if the call succeeds, the file returned is guaranteed to be new.
876
872
///
877
873
/// This option is useful because it is atomic. Otherwise between checking
878
874
/// whether a file exists and creating a new one, the file may have been
You can’t perform that action at this time.
0 commit comments