]> git.lizzy.rs Git - rust.git/commitdiff
Add note for append method in OpenOptions docs
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 13 Sep 2017 12:47:50 +0000 (14:47 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 13 Sep 2017 12:47:50 +0000 (14:47 +0200)
src/libstd/fs.rs

index 6014e765284700d1cc4833f3c924fe7eeb16acc9..2a916b819cca32290a091321bc65d66ba533a262 100644 (file)
@@ -569,11 +569,17 @@ pub fn write(&mut self, write: bool) -> &mut OpenOptions {
     /// end of the file. So, before writing, save the current position (using
     /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`, and restore it before the next read.
     ///
+    /// ## Note
+    ///
+    /// This function doesn't create the file if it doesn't exist. Use the [`create`]
+    /// method to do so.
+    ///
     /// [`write()`]: ../../std/fs/struct.File.html#method.write
     /// [`flush()`]: ../../std/fs/struct.File.html#method.flush
     /// [`seek`]: ../../std/fs/struct.File.html#method.seek
     /// [`SeekFrom`]: ../../std/io/enum.SeekFrom.html
     /// [`Current`]: ../../std/io/enum.SeekFrom.html#variant.Current
+    /// [`create`]: #method.create
     ///
     /// # Examples
     ///