From 8f410d1ead74b979481f1488a4dcddd33ea829c7 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Thu, 25 Aug 2022 21:27:39 +1200 Subject: Initial commit --- src/operations.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/operations.rs (limited to 'src/operations.rs') diff --git a/src/operations.rs b/src/operations.rs new file mode 100644 index 0000000..54ce8c7 --- /dev/null +++ b/src/operations.rs @@ -0,0 +1,30 @@ +use crate::*; +use std::path::Path; + +mod ls; +pub use ls::*; + +mod cp; +pub use cp::*; + +mod rm; +pub use rm::*; + +mod mkdir; +pub use mkdir::*; + +pub fn append_to_file

(_path: P, _content: &str) -> Result<(), EntryWriteError> +where + P: AsRef, +{ + unimplemented!() +} + +pub fn write_to_file

(path: P, content: &str) -> Result<(), EntryWriteError> +where + P: AsRef, +{ + make_parent_directory(&path)?; + std::fs::write(&path, content)?; + Ok(()) +} -- cgit v1.2.3-70-g09d2