From f42a480cbe487fc5fb9b3772990e80926201f6e4 Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Tue, 21 Jun 2022 15:38:48 +0200 Subject: gptman: reorganize commands in a cmd module --- volume/volume.ha | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 volume/volume.ha (limited to 'volume') diff --git a/volume/volume.ha b/volume/volume.ha deleted file mode 100644 index 832a96f..0000000 --- a/volume/volume.ha +++ /dev/null @@ -1,37 +0,0 @@ -use fmt; -use fs; -use io; -use os; - -use gpt; - -export fn mkvol(vol: str) io::file = { - return match (os::create(vol, fs::mode::USER_RWX | fs::mode::GROUP_RX | fs::mode::OTHER_RX, fs::flags::RDWR)) { - case let v: io::file => - yield v; - case => - fmt::fatalf("{}: cannot open file {}", os::args[0], vol); - }; -}; - -export fn openvol(vol: str) io::file = { - return match (os::open(vol, fs::flags::RDWR)) { - case let v: io::file => - yield v; - case => - fmt::fatalf("{}: cannot open file {}", os::args[0], vol); - }; -}; - -export fn opengpt(vol: str) *gpt::gpt = { - const vol = openvol(vol); - - return match (gpt::from(vol)) { - case let g: *gpt::gpt => - yield g; - case io::error => - fmt::fatalf("{}: could not properly read disk {}", os::args[0], os::args[1]); - case => - fmt::fatalf("{}: no valid gpt in disk", os::args[0]); - }; -}; -- cgit v1.2.3