Lines Matching refs:path

19 use crate::path::SMALL_PATH_BUFFER_SIZE;
22 use crate::{backend, io, path};
41 /// `openat(dirfd, path, oflags, mode)`—Opens a file.
56 pub fn openat<P: path::Arg, Fd: AsFd>(
58 path: P,
62 path.into_with_c_str(|path| {
63 backend::fs::syscalls::openat(dirfd.as_fd(), path, oflags, create_mode)
67 /// `readlinkat(fd, path)`—Reads the contents of a symlink.
78 pub fn readlinkat<P: path::Arg, Fd: AsFd, B: Into<Vec<u8>>>(
80 path: P,
83 path.into_with_c_str(|path| _readlinkat(dirfd.as_fd(), path, reuse.into()))
86 fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec<u8>) -> io::Result<CString> {
94 let nread = backend::fs::syscalls::readlinkat(dirfd.as_fd(), path, &mut buffer)?;
107 /// `mkdirat(fd, path, mode)`—Creates a directory.
116 pub fn mkdirat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Result<()> {
117 path.into_with_c_str(|path| backend::fs::syscalls::mkdirat(dirfd.as_fd(), path, mode))
130 pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
150 /// `unlinkat(fd, path, flags)`—Unlinks a file or remove a directory.
163 pub fn unlinkat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<()> {
164 path.into_with_c_str(|path| backend::fs::syscalls::unlinkat(dirfd.as_fd(), path, flags))
177 pub fn renameat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
205 pub fn renameat_with<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
234 pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
246 /// `fstatat(dirfd, path, flags)`—Queries metadata for a file or directory.
261 pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<Stat> {
262 path.into_with_c_str(|path| backend::fs::syscalls::statat(dirfd.as_fd(), path, flags))
265 /// `faccessat(dirfd, path, access, flags)`—Tests permissions for a file or
277 pub fn accessat<P: path::Arg, Fd: AsFd>(
279 path: P,
283 path.into_with_c_str(|path| backend::fs::syscalls::accessat(dirfd.as_fd(), path, access, flags))
286 /// `utimensat(dirfd, path, times, flags)`—Sets file or directory timestamps.
295 pub fn utimensat<P: path::Arg, Fd: AsFd>(
297 path: P,
301 path.into_with_c_str(|path| backend::fs::syscalls::utimensat(dirfd.as_fd(), path, times, flags))
304 /// `fchmodat(dirfd, path, mode, 0)`—Sets file or directory permissions.
321 pub fn chmodat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Result<()> {
322 path.into_with_c_str(|path| backend::fs::syscalls::chmodat(dirfd.as_fd(), path, mode))
333 pub fn fclonefileat<Fd: AsFd, DstFd: AsFd, P: path::Arg>(
344 /// `mknodat(dirfd, path, mode, dev)`—Creates special or normal files.
354 pub fn mknodat<P: path::Arg, Fd: AsFd>(
356 path: P,
361 path.into_with_c_str(|path| {
362 backend::fs::syscalls::mknodat(dirfd.as_fd(), path, file_type, mode, dev)
366 /// `fchownat(dirfd, path, owner, group, flags)`—Sets file or directory
378 pub fn chownat<P: path::Arg, Fd: AsFd>(
380 path: P,
385 path.into_with_c_str(|path| {
386 backend::fs::syscalls::chownat(dirfd.as_fd(), path, owner, group, flags)