Zig 0.16: yet more boring fs/io

This commit is contained in:
LN Liberda 2026-05-23 00:45:01 +02:00
parent e93eacd755
commit 1d77117d8c

View file

@ -145,9 +145,9 @@ pub fn statAt(parent: std.Io.Dir, name: [:0]const u8, follow: bool, symlink: ?*b
fn isCacheDir(dir: std.Io.Dir) bool {
const sig = "Signature: 8a477f597d28d172789f06886806bc55";
const f = dir.openFile(main.io, "CACHEDIR.TAG", .{}) catch return false;
defer f.close();
defer f.close(main.io);
var buf: [sig.len]u8 = undefined;
const len = f.readAll(&buf) catch return false;
const len = f.readPositionalAll(main.io, &buf, 0) catch return false;
return len == sig.len and std.mem.eql(u8, &buf, sig);
}