mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-11-03 21:49:42 -09:00
Zig 0.16: boring fs/io
This commit is contained in:
parent
4179f5635a
commit
9103bae106
1 changed files with 3 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ fn truncate(comptime T: type, comptime field: anytype, x: anytype) std.meta.fiel
|
|||
}
|
||||
|
||||
|
||||
pub fn statAt(parent: std.fs.Dir, name: [:0]const u8, follow: bool, symlink: ?*bool) !sink.Stat {
|
||||
pub fn statAt(parent: std.Io.Dir, name: [:0]const u8, follow: bool, symlink: ?*bool) !sink.Stat {
|
||||
// std.posix.fstatatZ() in Zig 0.14 is not suitable due to https://github.com/ziglang/zig/issues/23463
|
||||
var stat: std.c.Stat = undefined;
|
||||
if (std.c.fstatat(parent.fd, name, &stat, if (follow) 0 else std.c.AT.SYMLINK_NOFOLLOW) != 0) {
|
||||
|
|
@ -299,8 +299,8 @@ pub fn scan(path: [:0]const u8) !void {
|
|||
defer sink.done();
|
||||
|
||||
var symlink: bool = undefined;
|
||||
const stat = try statAt(std.fs.cwd(), path, true, &symlink);
|
||||
const fd = try std.fs.cwd().openDirZ(path, .{ .iterate = true });
|
||||
const stat = try statAt(std.Io.Dir.cwd(), path, true, &symlink);
|
||||
const fd = try std.Io.Dir.cwd().openDir(main.io, path, .{ .iterate = true });
|
||||
|
||||
var state = State{
|
||||
.threads = main.allocator.alloc(Thread, main.config.threads) catch unreachable,
|
||||
|
|
|
|||
Loading…
Reference in a new issue