MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / rename

Function rename

src/fs/abs.rs:150–154  ·  view source on GitHub ↗
(old_path: P, new_path: Q)

Source from the content-addressed store, hash-verified

148/// [Linux]: https://man7.org/linux/man-pages/man2/rename.2.html
149#[inline]
150pub fn rename<P: path::Arg, Q: path::Arg>(old_path: P, new_path: Q) -> io::Result<()> {
151 old_path.into_with_c_str(|old_path| {
152 new_path.into_with_c_str(|new_path| backend::fs::syscalls::rename(old_path, new_path))
153 })
154}
155
156/// `unlink(path)`—Unlinks a file.
157///

Callers 2

test_renameFunction · 0.50
test_inotify_iterFunction · 0.50

Calls 1

into_with_c_strMethod · 0.80

Tested by 2

test_renameFunction · 0.40
test_inotify_iterFunction · 0.40