dirfd dir operations (3/4) - #160533
Conversation
|
Any special-casing of Miri in the standard library requires review. cc @rust-lang/miri |
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// | ||
| /// # Errors | ||
| /// | ||
| /// This function will return an error if `path` does not point to an existing directory. |
There was a problem hiding this comment.
I think we follow symlinks, right? Should we note that here?
There was a problem hiding this comment.
We do follow them, but I don't think we need to note it. Dir::open and File::open (and maybe others) also follow symlinks without documenting that fact. If we decide that we should note it, that's a follow-up PR.
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
|
@bors r+ |
…crum dirfd dir operations (3/4) Previous PR: rust-lang#150679 Reference: rust-lang#139514 Tracking issue: rust-lang#120426
Rollup of 7 pull requests Successful merges: - #160533 (dirfd dir operations (3/4)) - #160675 (bootstrap: Remove `PATH_REMAP` from command-line selector handling ) - #160807 (Update rustc crate rkyv to 0.8.18) - #160560 (Add nightly-only support for Cargo unremap trim-paths files in `rust-gdb`) - #160804 (Change .expect message on net/parser to follow precondition style) - #160805 (`extern "custom"`: add tests) - #160816 (Mark const ptr methods and free functions as inline(always) to match *mut)
|
|
This pull request was unapproved. This PR was contained in a rollup (#160823), which was unapproved. |
| @@ -87,6 +93,22 @@ impl Dir { | |||
| self.rename_native(&from, to_dir, &to, is_dir) | |||
| } | |||
|
|
|||
| pub fn create_dir(&self, path: &Path) -> io::Result<()> { | |||
| let mut opts = OpenOptions::new(); | |||
| opts.create_new(true); | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
I think it's preferable to chain this and write it as:
let opts = OpenOptions::new().read(true)
.write(true)
.create_new(true);|
@rustbot ready |
View all comments
Previous PR: #150679
Reference: #139514
Tracking issue: #120426