mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-11-03 21:49:42 -09:00
Zig 0.16: yet more boring fs/io
This commit is contained in:
parent
e93eacd755
commit
1d77117d8c
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue