summaryrefslogtreecommitdiff
path: root/src/operations.rs
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2022-08-25 21:27:39 +1200
committerBen Bridle <bridle.benjamin@gmail.com>2022-08-25 21:27:39 +1200
commit8f410d1ead74b979481f1488a4dcddd33ea829c7 (patch)
tree2f22fd930c8d0cdb4de53fef473f7770073e14d5 /src/operations.rs
downloadvagabond-1.0.zip
Initial commitv1.0
Diffstat (limited to 'src/operations.rs')
-rw-r--r--src/operations.rs30
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(())
+}