summaryrefslogtreecommitdiff
path: root/mkfs.aya/src/main.rs
diff options
context:
space:
mode:
authorChuyan Zhang <me@zcy.moe>2023-11-30 02:15:06 -0800
committerChuyan Zhang <me@zcy.moe>2023-11-30 02:15:06 -0800
commit1eac97eea4ec0bcef0be061a2cba93a584355283 (patch)
treed98fb1f6e3811286a0733c9df21e467590635ad2 /mkfs.aya/src/main.rs
parentb3db8a5a710aa0890c80241ffb3fd9792bf1cbe7 (diff)
downloadmyfs-1eac97eea4ec0bcef0be061a2cba93a584355283.tar.gz
myfs-1eac97eea4ec0bcef0be061a2cba93a584355283.zip
Add real disk i/o, add mkfs.aya (not yet implemented)
Diffstat (limited to 'mkfs.aya/src/main.rs')
-rw-r--r--mkfs.aya/src/main.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/mkfs.aya/src/main.rs b/mkfs.aya/src/main.rs
new file mode 100644
index 0000000..57ca3fc
--- /dev/null
+++ b/mkfs.aya/src/main.rs
@@ -0,0 +1,21 @@
+mod block_device;
+
+use std::fs::File;
+use std::path::PathBuf;
+use clap::Parser;
+use users::{get_current_gid, get_current_uid};
+
+#[derive(Parser, Debug)]
+#[command(author, version, about)]
+struct Args {
+ block_device: Option<PathBuf>,
+ start_point: Option<usize>,
+ length: Option<usize>,
+}
+
+fn main() {
+ let args = Args::parse();
+ let device_path = args.block_device.unwrap();
+ println!("{:?}", device_path.as_path());
+ let mut device = File::open(device_path.as_path()).unwrap();
+} \ No newline at end of file