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