diff options
Diffstat (limited to 'src/operations.rs')
-rw-r--r-- | src/operations.rs | 30 |
1 files changed, 30 insertions, 0 deletions
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<P>(_path: P, _content: &str) -> Result<(), EntryWriteError> +where + P: AsRef<Path>, +{ + unimplemented!() +} + +pub fn write_to_file<P>(path: P, content: &str) -> Result<(), EntryWriteError> +where + P: AsRef<Path>, +{ + make_parent_directory(&path)?; + std::fs::write(&path, content)?; + Ok(()) +} |