Moved to File.MemoryMap instead of direct file I/O

This commit is contained in:
Caleb Gardner
2026-05-22 12:49:07 -05:00
parent 8186c3fe9a
commit 0df14b8adc
13 changed files with 126 additions and 427 deletions
+6 -9
View File
@@ -48,21 +48,18 @@ pub fn main(init: std.process.Init) !void {
var out = stdout.writer(io, &[0]u8{});
defer out.interface.flush() catch {};
// try handleArgs(init.minimal.args, &out.interface);
// if (archive.len == 0) {
// try out.interface.print("You must provide a squashfs archive\n", .{});
// try out.interface.print(help_mgs, .{});
// return;
// }
archive = "testing/LinuxPATest.sfs";
extLoc = "testing/LinuxPABinTest";
try handleArgs(init.minimal.args, &out.interface);
if (archive.len == 0) {
try out.interface.print("You must provide a squashfs archive\n", .{});
try out.interface.print(help_mgs, .{});
return;
}
var fil = try Io.Dir.cwd().openFile(io, archive, .{}); //TODO: Handle error gracefully.
defer fil.close(io);
var arc: squashfs.Archive = try .init(io, fil, offset); //TODO: Handle error gracefully.
const options: squashfs.ExtractionOptions = .{
.threads = if (threads == 0) try std.Thread.getCpuCount() else threads,
.verbose = verbose,
.verbose_writer = if (verbose) &out.interface else null,
.ignore_xattr = ignore_xattrs,