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