File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,14 @@ pub trait FileExt {
149149 /// Note that similar to [`File::write`], it is not an error to return a
150150 /// short write.
151151 ///
152+ /// # Bug
153+ /// On some systems, due to a [bug] with [`pwrite64`] (the underlying
154+ /// syscall), files opened with the `O_APPEND` flag fail to respect the
155+ /// offset parameter, always appending to the end of the file instead.
156+ ///
152157 /// [`File::write`]: fs::File::write
158+ /// [`pwrite64`]: https://man7.org/linux/man-pages/man2/pwrite.2.html
159+ /// [bug]: https://man7.org/linux/man-pages/man2/pwrite.2.html#BUGS
153160 ///
154161 /// # Examples
155162 ///
@@ -159,7 +166,7 @@ pub trait FileExt {
159166 /// use std::os::unix::prelude::FileExt;
160167 ///
161168 /// fn main() -> io::Result<()> {
162- /// let file = File::open ("foo.txt")?;
169+ /// let file = File::create ("foo.txt")?;
163170 ///
164171 /// // We now write at the offset 10.
165172 /// file.write_at(b"sushi", 10)?;
You can’t perform that action at this time.
0 commit comments