From 8394ecdc433a4452dd55856264413c03f599900f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kj=C3=A4ll?= Date: Fri, 1 May 2026 09:20:53 +0200 Subject: [PATCH] Document which open commands will follow symlinks --- library/std/src/fs.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index c2ffd0793a816..40930d3094290 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -548,6 +548,8 @@ impl File { /// consider [`std::fs::read()`][self::read] or /// [`std::fs::read_to_string()`][self::read_to_string] instead. /// + /// This call follows symlinks. + /// /// # Errors /// /// This function will return an error if `path` does not already exist. @@ -580,6 +582,8 @@ impl File { /// consider [`std::fs::read()`][self::read] or /// [`std::fs::read_to_string()`][self::read_to_string] instead. /// + /// This call follows symlinks. + /// /// # Errors /// /// This function will return an error if `path` does not already exist, @@ -622,6 +626,8 @@ impl File { /// See also [`std::fs::write()`][self::write] for a simple function to /// create a file with some given data. /// + /// This call follows symlinks. + /// /// # Examples /// /// ```no_run @@ -653,6 +659,8 @@ impl File { /// See also [`std::fs::write()`][self::write] for a simple function to /// create a file with some given data. /// + /// This call follows symlinks. + /// /// # Examples /// /// ```no_run @@ -696,6 +704,8 @@ impl File { /// [`AlreadyExists`]: crate::io::ErrorKind::AlreadyExists /// [TOCTOU]: self#time-of-check-to-time-of-use-toctou /// + /// This call does not follows symlinks. + /// /// # Examples /// /// ```no_run