2019-08-08 12:44:48 +00:00
|
|
|
//! Filesystem manipulation operations.
|
|
|
|
//!
|
|
|
|
//! This module is an async version of [`std::fs`].
|
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! [`os::unix::fs`]: ../os/unix/fs/index.html
|
2019-11-18 02:07:47 +00:00
|
|
|
//! [`os::windows::fs`]: ../os/windows/fs/index.html
|
2019-08-08 12:44:48 +00:00
|
|
|
//! [`std::fs`]: https://doc.rust-lang.org/std/fs/index.html
|
|
|
|
//!
|
2019-09-11 14:13:17 +00:00
|
|
|
//! # Platform-specific extensions
|
|
|
|
//!
|
|
|
|
//! * Unix: use the [`os::unix::fs`] module.
|
2019-11-18 02:07:47 +00:00
|
|
|
//! * Windows: use the [`os::windows::fs`] module.
|
2019-09-11 14:13:17 +00:00
|
|
|
//!
|
2019-08-08 12:44:48 +00:00
|
|
|
//! # Examples
|
|
|
|
//!
|
|
|
|
//! Create a new file and write some bytes to it:
|
|
|
|
//!
|
|
|
|
//! ```no_run
|
2019-08-09 00:56:59 +00:00
|
|
|
//! # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
|
|
|
|
//! #
|
2019-08-08 12:44:48 +00:00
|
|
|
//! use async_std::fs::File;
|
|
|
|
//! use async_std::prelude::*;
|
|
|
|
//!
|
2019-08-12 18:29:06 +00:00
|
|
|
//! let mut file = File::create("a.txt").await?;
|
2019-08-08 12:44:48 +00:00
|
|
|
//! file.write_all(b"Hello, world!").await?;
|
2019-08-09 00:56:59 +00:00
|
|
|
//! #
|
|
|
|
//! # Ok(()) }) }
|
2019-08-08 12:44:48 +00:00
|
|
|
//! ```
|
|
|
|
|
|
|
|
pub use dir_builder::DirBuilder;
|
|
|
|
pub use dir_entry::DirEntry;
|
|
|
|
pub use file::File;
|
2019-09-11 14:13:17 +00:00
|
|
|
pub use file_type::FileType;
|
|
|
|
pub use metadata::Metadata;
|
2019-09-14 07:15:51 +00:00
|
|
|
pub use open_options::OpenOptions;
|
2019-09-11 14:13:17 +00:00
|
|
|
pub use permissions::Permissions;
|
2019-08-08 12:44:48 +00:00
|
|
|
pub use read_dir::ReadDir;
|
|
|
|
|
2019-08-12 17:45:25 +00:00
|
|
|
pub use canonicalize::canonicalize;
|
|
|
|
pub use copy::copy;
|
|
|
|
pub use create_dir::create_dir;
|
2019-08-26 19:47:15 +00:00
|
|
|
pub use create_dir_all::create_dir_all;
|
2019-08-12 17:45:25 +00:00
|
|
|
pub use hard_link::hard_link;
|
|
|
|
pub use metadata::metadata;
|
|
|
|
pub use read::read;
|
|
|
|
pub use read_dir::read_dir;
|
|
|
|
pub use read_link::read_link;
|
|
|
|
pub use read_to_string::read_to_string;
|
|
|
|
pub use remove_dir::remove_dir;
|
|
|
|
pub use remove_dir_all::remove_dir_all;
|
|
|
|
pub use remove_file::remove_file;
|
|
|
|
pub use rename::rename;
|
|
|
|
pub use set_permissions::set_permissions;
|
|
|
|
pub use symlink_metadata::symlink_metadata;
|
|
|
|
pub use write::write;
|
|
|
|
|
|
|
|
mod canonicalize;
|
|
|
|
mod copy;
|
|
|
|
mod create_dir;
|
2019-08-26 19:47:15 +00:00
|
|
|
mod create_dir_all;
|
2019-08-08 12:44:48 +00:00
|
|
|
mod dir_builder;
|
|
|
|
mod dir_entry;
|
|
|
|
mod file;
|
2019-09-11 14:13:17 +00:00
|
|
|
mod file_type;
|
2019-08-12 17:45:25 +00:00
|
|
|
mod hard_link;
|
|
|
|
mod metadata;
|
2019-08-08 12:44:48 +00:00
|
|
|
mod open_options;
|
2019-09-11 14:13:17 +00:00
|
|
|
mod permissions;
|
2019-08-12 17:45:25 +00:00
|
|
|
mod read;
|
2019-08-08 12:44:48 +00:00
|
|
|
mod read_dir;
|
2019-08-12 17:45:25 +00:00
|
|
|
mod read_link;
|
|
|
|
mod read_to_string;
|
|
|
|
mod remove_dir;
|
|
|
|
mod remove_dir_all;
|
|
|
|
mod remove_file;
|
|
|
|
mod rename;
|
|
|
|
mod set_permissions;
|
|
|
|
mod symlink_metadata;
|
|
|
|
mod write;
|