File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -844,10 +844,7 @@ impl OpenOptions {
844844 self
845845 }
846846
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.
851848 ///
852849 /// In order for the file to be created, [`write`] or [`append`] access must
853850 /// be used.
@@ -868,11 +865,10 @@ impl OpenOptions {
868865 self
869866 }
870867
871- /// Sets the option to always create a new file.
868+ /// Sets the option to create a new file, failing if it already exists .
872869 ///
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.
876872 ///
877873 /// This option is useful because it is atomic. Otherwise between checking
878874 /// 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