1//! Filesystem operations.
2
3mod abs;
4#[cfg(not(target_os = "redox"))]
5mod at;
6mod constants;
7#[cfg(linux_kernel)]
8mod copy_file_range;
9#[cfg(not(target_os = "redox"))]
10mod cwd;
11#[cfg(not(target_os = "redox"))]
12mod dir;
13#[cfg(not(any(
14 apple,
15 netbsdlike,
16 solarish,
17 target_os = "dragonfly",
18 target_os = "haiku",
19 target_os = "redox",
20)))]
21mod fadvise;
22pub(crate) mod fcntl;
23#[cfg(apple)]
24mod fcntl_apple;
25#[cfg(apple)]
26mod fcopyfile;
27pub(crate) mod fd;
28mod file_type;
29#[cfg(apple)]
30mod getpath;
31#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
32mod makedev;
33#[cfg(any(linux_kernel, target_os = "freebsd"))]
34mod memfd_create;
35#[cfg(linux_kernel)]
36mod mount;
37#[cfg(linux_kernel)]
38mod openat2;
39#[cfg(linux_kernel)]
40mod raw_dir;
41#[cfg(target_os = "linux")]
42mod sendfile;
43#[cfg(linux_kernel)]
44mod statx;
45#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
46mod sync;
47#[cfg(any(apple, linux_kernel))]
48mod xattr;
49
50#[cfg(linux_kernel)]
51pub use crate::backend::fs::inotify;
52pub use abs::*;
53#[cfg(not(target_os = "redox"))]
54pub use at::*;
55pub use constants::*;
56#[cfg(linux_kernel)]
57pub use copy_file_range::copy_file_range;
58#[cfg(not(target_os = "redox"))]
59pub use cwd::cwd;
60#[cfg(not(target_os = "redox"))]
61pub use dir::{Dir, DirEntry};
62#[cfg(not(any(
63 apple,
64 netbsdlike,
65 solarish,
66 target_os = "dragonfly",
67 target_os = "haiku",
68 target_os = "redox",
69)))]
70pub use fadvise::{fadvise, Advice};
71pub use fcntl::*;
72#[cfg(apple)]
73pub use fcntl_apple::{fcntl_fullfsync, fcntl_rdadvise};
74#[cfg(apple)]
75pub use fcopyfile::*;
76pub use fd::*;
77pub use file_type::FileType;
78#[cfg(apple)]
79pub use getpath::getpath;
80#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
81pub use makedev::*;
82#[cfg(any(linux_kernel, target_os = "freebsd"))]
83pub use memfd_create::{memfd_create, MemfdFlags};
84#[cfg(linux_kernel)]
85pub use mount::*;
86#[cfg(linux_kernel)]
87pub use openat2::openat2;
88#[cfg(linux_kernel)]
89pub use raw_dir::{RawDir, RawDirEntry};
90#[cfg(target_os = "linux")]
91pub use sendfile::sendfile;
92#[cfg(linux_kernel)]
93pub use statx::{statx, Statx, StatxFlags, StatxTimestamp};
94#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
95pub use sync::sync;
96#[cfg(any(apple, linux_kernel))]
97pub use xattr::*;
98
99/// Re-export types common to POSIX-ish platforms.
100#[cfg(feature = "std")]
101#[cfg(unix)]
102pub use std::os::unix::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};
103#[cfg(feature = "std")]
104#[cfg(all(wasi_ext, target_os = "wasi"))]
105pub use std::os::wasi::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};
106