diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2022-08-25 21:27:39 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2022-08-25 21:27:39 +1200 |
commit | 8f410d1ead74b979481f1488a4dcddd33ea829c7 (patch) | |
tree | 2f22fd930c8d0cdb4de53fef473f7770073e14d5 /src/operations.rs | |
download | vagabond-79748a9b6c03b6d1926a765c2f0944ec2575f4cd.zip |
Initial commitv1.0
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(()) +} |