@@ -560,14 +560,26 @@ impl OpenOptions {
560
560
///
561
561
/// One maybe obvious note when using append-mode: make sure that all data
562
562
/// that belongs together is written to the file in one operation. This
563
- /// can be done by concatenating strings before passing them to `write()`,
563
+ /// can be done by concatenating strings before passing them to [ `write()`] ,
564
564
/// or using a buffered writer (with a buffer of adequate size),
565
- /// and calling `flush()` when the message is complete.
565
+ /// and calling [ `flush()`] when the message is complete.
566
566
///
567
567
/// If a file is opened with both read and append access, beware that after
568
568
/// opening, and after every write, the position for reading may be set at the
569
569
/// end of the file. So, before writing, save the current position (using
570
- /// `seek(SeekFrom::Current(0))`, and restore it before the next read.
570
+ /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`, and restore it before the next read.
571
+ ///
572
+ /// ## Note
573
+ ///
574
+ /// This function doesn't create the file if it doesn't exist. Use the [`create`]
575
+ /// method to do so.
576
+ ///
577
+ /// [`write()`]: ../../std/fs/struct.File.html#method.write
578
+ /// [`flush()`]: ../../std/fs/struct.File.html#method.flush
579
+ /// [`seek`]: ../../std/fs/struct.File.html#method.seek
580
+ /// [`SeekFrom`]: ../../std/io/enum.SeekFrom.html
581
+ /// [`Current`]: ../../std/io/enum.SeekFrom.html#variant.Current
582
+ /// [`create`]: #method.create
571
583
///
572
584
/// # Examples
573
585
///
@@ -605,9 +617,12 @@ impl OpenOptions {
605
617
/// This option indicates whether a new file will be created if the file
606
618
/// does not yet already exist.
607
619
///
608
- /// In order for the file to be created, `write` or `append` access must
620
+ /// In order for the file to be created, [ `write`] or [ `append`] access must
609
621
/// be used.
610
622
///
623
+ /// [`write`]: #method.write
624
+ /// [`append`]: #method.append
625
+ ///
611
626
/// # Examples
612
627
///
613
628
/// ```no_run
@@ -630,12 +645,15 @@ impl OpenOptions {
630
645
/// whether a file exists and creating a new one, the file may have been
631
646
/// created by another process (a TOCTOU race condition / attack).
632
647
///
633
- /// If `.create_new(true)` is set, `.create()` and `.truncate()` are
648
+ /// If `.create_new(true)` is set, [ `.create()`] and [ `.truncate()`] are
634
649
/// ignored.
635
650
///
636
651
/// The file must be opened with write or append access in order to create
637
652
/// a new file.
638
653
///
654
+ /// [`.create()`]: #method.create
655
+ /// [`.truncate()`]: #method.truncate
656
+ ///
639
657
/// # Examples
640
658
///
641
659
/// ```no_run
0 commit comments