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