Name Description Size
abs.rs POSIX-style filesystem functions which operate on bare paths. 10050
at.rs POSIX-style `*at` functions. The `dirfd` argument to these functions may be a file descriptor for a directory, the special value [`CWD`], or the special value [`ABS`]. [`CWD`]: crate::fs::CWD [`ABS`]: crate::fs::ABS 15485
constants.rs Filesystem API constants, translated into `bitflags` constants. 199
copy_file_range.rs 565
cwd.rs The `cwd` function, representing the current working directory. # Safety This file uses `AT_FDCWD`, which is a raw file descriptor, but which is always valid. 661
dir.rs `Dir` and `DirEntry`. 91
fadvise.rs 603
fcntl.rs The Unix `fcntl` function is effectively lots of different functions hidden behind a single dynamic dispatch interface. In order to provide a type-safe API, rustix makes them all separate functions so that they can have dedicated static type signatures. 3684
fcntl_apple.rs 2243
fcopyfile.rs 2623
fd.rs Functions which operate on file descriptors. 11903
getpath.rs 384
id.rs 33
inotify.rs inotify support for working with inotify objects. # Examples ``` use rustix::fs::inotify; use rustix::io; use std::mem::MaybeUninit; # fn test() -> io::Result<()> { // Create an inotify object. In this example, we use `NONBLOCK` so that the // reader fails with `WOULDBLOCK` when no events are ready. Otherwise it // will block until at least one event is ready. let inotify = inotify::init(inotify::CreateFlags::NONBLOCK)?; // Add a directory to watch. inotify::add_watch( &inotify, "/path/to/some/directory/to/watch", inotify::WatchFlags::ALL_EVENTS, )?; // Generate some events in the watched directory… // Loop over pending events. let mut buf = [MaybeUninit::uninit(); 512]; let mut iter = inotify::Reader::new(inotify, &mut buf); loop { let entry = match iter.next() { // Stop iterating if there are no more events for now. Err(io::Errno::WOULDBLOCK) => break, Err(e) => return Err(e), Ok(entry) => entry, }; // Use `entry`… } # Ok(()) # } 7218
ioctl.rs Filesystem-oriented `ioctl` functions. 5655
makedev.rs 677
memfd_create.rs 633
mod.rs Filesystem operations. 5076
mount.rs Linux `mount`. These have been moved to a new `rustix::mount` module. 1696
openat2.rs 613
raw_dir.rs `RawDir` and `RawDirEntry`. 7386
seek_from.rs The following is derived from Rust's library/std/src/io/mod.rs at revision dca3f1b786efd27be3b325ed1e01e247aa589c3b. 2236
sendfile.rs 468
special.rs The `CWD` and `ABS` constants, representing the current working directory and absolute-only paths, respectively. # Safety This file uses `AT_FDCWD`, which is a raw file descriptor, but which is always valid, and `-EBADF`, which is an undocumented by commonly used convention of passing a value which will always fail if the accompanying path isn't absolute. 2601
statx.rs Linux `statx`. 4133
sync.rs 347
xattr.rs 6057