rustix/fs/
mod.rs

1//! Filesystem operations.
2
3mod abs;
4mod at;
5mod constants;
6#[cfg(linux_kernel)]
7mod copy_file_range;
8#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))]
9mod dir;
10#[cfg(not(any(
11    apple,
12    netbsdlike,
13    target_os = "dragonfly",
14    target_os = "espidf",
15    target_os = "haiku",
16    target_os = "horizon",
17    target_os = "redox",
18    target_os = "solaris",
19    target_os = "vita",
20)))]
21mod fadvise;
22pub(crate) mod fcntl;
23#[cfg(apple)]
24mod fcntl_apple;
25#[cfg(apple)]
26mod fcopyfile;
27pub(crate) mod fd;
28#[cfg(all(apple, feature = "alloc"))]
29mod getpath;
30#[cfg(not(target_os = "wasi"))] // WASI doesn't have get[gpu]id.
31mod id;
32#[cfg(linux_raw_dep)]
33pub mod inotify;
34#[cfg(linux_kernel)]
35mod ioctl;
36#[cfg(not(any(
37    target_os = "espidf",
38    target_os = "haiku",
39    target_os = "horizon",
40    target_os = "vita",
41    target_os = "wasi"
42)))]
43mod makedev;
44#[cfg(any(linux_kernel, target_os = "freebsd"))]
45mod memfd_create;
46#[cfg(linux_raw_dep)]
47mod openat2;
48#[cfg(linux_kernel)]
49mod raw_dir;
50mod seek_from;
51#[cfg(target_os = "linux")]
52mod sendfile;
53#[cfg(not(target_os = "espidf"))]
54mod special;
55#[cfg(linux_kernel)]
56mod statx;
57#[cfg(not(any(
58    target_os = "espidf",
59    target_os = "horizon",
60    target_os = "redox",
61    target_os = "vita",
62    target_os = "wasi"
63)))]
64mod sync;
65#[cfg(any(apple, linux_kernel, target_os = "hurd"))]
66mod xattr;
67
68pub use abs::*;
69pub use at::*;
70pub use constants::*;
71#[cfg(linux_kernel)]
72pub use copy_file_range::copy_file_range;
73#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))]
74pub use dir::{Dir, DirEntry};
75#[cfg(not(any(
76    apple,
77    netbsdlike,
78    target_os = "dragonfly",
79    target_os = "espidf",
80    target_os = "haiku",
81    target_os = "horizon",
82    target_os = "redox",
83    target_os = "solaris",
84    target_os = "vita",
85)))]
86pub use fadvise::fadvise;
87pub use fcntl::*;
88#[cfg(apple)]
89pub use fcntl_apple::*;
90#[cfg(apple)]
91pub use fcopyfile::*;
92pub use fd::*;
93#[cfg(all(apple, feature = "alloc"))]
94pub use getpath::getpath;
95#[cfg(not(target_os = "wasi"))]
96pub use id::*;
97#[cfg(linux_kernel)]
98pub use ioctl::*;
99#[cfg(not(any(
100    target_os = "espidf",
101    target_os = "haiku",
102    target_os = "horizon",
103    target_os = "vita",
104    target_os = "wasi"
105)))]
106pub use makedev::*;
107#[cfg(any(linux_kernel, target_os = "freebsd"))]
108pub use memfd_create::memfd_create;
109#[cfg(linux_raw_dep)]
110pub use openat2::openat2;
111#[cfg(linux_kernel)]
112pub use raw_dir::{RawDir, RawDirEntry};
113pub use seek_from::SeekFrom;
114#[cfg(target_os = "linux")]
115pub use sendfile::sendfile;
116#[cfg(not(target_os = "espidf"))]
117pub use special::*;
118#[cfg(linux_kernel)]
119pub use statx::*;
120#[cfg(not(any(
121    target_os = "espidf",
122    target_os = "horizon",
123    target_os = "redox",
124    target_os = "vita",
125    target_os = "wasi"
126)))]
127pub use sync::sync;
128#[cfg(any(apple, linux_kernel, target_os = "hurd"))]
129pub use xattr::*;
130
131/// Re-export types common to POSIX-ish platforms.
132#[cfg(feature = "std")]
133#[cfg(unix)]
134pub use std::os::unix::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};
135#[cfg(feature = "std")]
136#[cfg(all(wasi_ext, target_os = "wasi"))]
137pub use std::os::wasi::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};