-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5160 from yagehu/yagehu/append-seek
Fix fd with append flag can't seek correctly
- Loading branch information
Showing
5 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::io::{Seek as _, SeekFrom}; | ||
|
||
fn main() { | ||
let offset = 100u64; | ||
let mut f = std::fs::OpenOptions::new() | ||
.read(true) | ||
.write(true) | ||
.create(true) | ||
.append(true) | ||
.open("/fyi/fs_seek_append.dir/file") | ||
.unwrap(); | ||
let new_offset = f.seek(SeekFrom::Start(offset)).unwrap(); | ||
|
||
assert_eq!(offset, new_offset); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.