1 | //! Filesystem manipulation operations. |
2 | //! |
3 | //! This module is an async version of [`std::fs`]. |
4 | //! |
5 | //! [`os::unix::fs`]: ../os/unix/fs/index.html |
6 | //! [`os::windows::fs`]: ../os/windows/fs/index.html |
7 | //! [`std::fs`]: https://doc.rust-lang.org/std/fs/index.html |
8 | //! |
9 | //! # Platform-specific extensions |
10 | //! |
11 | //! * Unix: use the [`os::unix::fs`] module. |
12 | //! * Windows: use the [`os::windows::fs`] module. |
13 | //! |
14 | //! # Examples |
15 | //! |
16 | //! Create a new file and write some bytes to it: |
17 | //! |
18 | //! ```no_run |
19 | //! # fn main() -> std::io::Result<()> { async_std::task::block_on(async { |
20 | //! # |
21 | //! use async_std::fs::File; |
22 | //! use async_std::prelude::*; |
23 | //! |
24 | //! let mut file = File::create("a.txt" ).await?; |
25 | //! file.write_all(b"Hello, world!" ).await?; |
26 | //! # |
27 | //! # Ok(()) }) } |
28 | //! ``` |
29 | |
30 | pub use dir_builder::DirBuilder; |
31 | pub use dir_entry::DirEntry; |
32 | pub use file::File; |
33 | pub use file_type::FileType; |
34 | pub use metadata::Metadata; |
35 | pub use open_options::OpenOptions; |
36 | pub use permissions::Permissions; |
37 | pub use read_dir::ReadDir; |
38 | |
39 | pub use canonicalize::canonicalize; |
40 | pub use copy::copy; |
41 | pub use create_dir::create_dir; |
42 | pub use create_dir_all::create_dir_all; |
43 | pub use hard_link::hard_link; |
44 | pub use metadata::metadata; |
45 | pub use read::read; |
46 | pub use read_dir::read_dir; |
47 | pub use read_link::read_link; |
48 | pub use read_to_string::read_to_string; |
49 | pub use remove_dir::remove_dir; |
50 | pub use remove_dir_all::remove_dir_all; |
51 | pub use remove_file::remove_file; |
52 | pub use rename::rename; |
53 | pub use set_permissions::set_permissions; |
54 | pub use symlink_metadata::symlink_metadata; |
55 | pub use write::write; |
56 | |
57 | mod canonicalize; |
58 | mod copy; |
59 | mod create_dir; |
60 | mod create_dir_all; |
61 | mod dir_builder; |
62 | mod dir_entry; |
63 | mod file; |
64 | mod file_type; |
65 | mod hard_link; |
66 | mod metadata; |
67 | mod open_options; |
68 | mod permissions; |
69 | mod read; |
70 | mod read_dir; |
71 | mod read_link; |
72 | mod read_to_string; |
73 | mod remove_dir; |
74 | mod remove_dir_all; |
75 | mod remove_file; |
76 | mod rename; |
77 | mod set_permissions; |
78 | mod symlink_metadata; |
79 | mod write; |
80 | |