use fmt; use mbr; use gpt; use sector; use os; use io; use fs; use strings; use errors; export fn convert(args: []str) void = { if (len(args) < 2) { fmt::fatalf("gptman.convert: needs disk"); }; fmt::println(args[1])!; let file = os::open(args[1], fs::flags::RDWR)!; defer io::close(file)!; let vol = gpt::from(file)!; gpt::mkbackup(vol); defer { gpt::chksums(vol); gpt::commit(vol); gpt::finish(vol); }; vol.primary.header.disk_guid[0] = 0xcafebabe; vol.primary.header.disk_guid[1] = 0xabababababababab; };