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

Function linkat

src/fs/at.rs:214–232  ·  view source on GitHub ↗
(
    old_dirfd: PFd,
    old_path: P,
    new_dirfd: QFd,
    new_path: Q,
    flags: AtFlags,
)

Source from the content-addressed store, hash-verified

212#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
213#[inline]
214pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
215 old_dirfd: PFd,
216 old_path: P,
217 new_dirfd: QFd,
218 new_path: Q,
219 flags: AtFlags,
220) -> io::Result<()> {
221 old_path.into_with_c_str(|old_path| {
222 new_path.into_with_c_str(|new_path| {
223 backend::fs::syscalls::linkat(
224 old_dirfd.as_fd(),
225 old_path,
226 new_dirfd.as_fd(),
227 new_path,
228 flags,
229 )
230 })
231 })
232}
233
234/// `unlinkat(fd, path, flags)`—Unlinks a file or remove a directory.
235///

Callers 1

test_linkatFunction · 0.50

Calls 2

into_with_c_strMethod · 0.80
as_fdMethod · 0.45

Tested by 1

test_linkatFunction · 0.40