std.Io.Threaded: implement dirStat

This commit is contained in:
Andrew Kelley 2025-11-25 06:46:53 -08:00
parent 3edce5ea12
commit d113257d42
2 changed files with 5 additions and 5 deletions

View file

@ -1499,9 +1499,8 @@ fn dirMakeOpenPathWasi(
fn dirStat(userdata: ?*anyopaque, dir: Io.Dir) Io.Dir.StatError!Io.Dir.Stat {
const t: *Threaded = @ptrCast(@alignCast(userdata));
_ = t;
_ = dir;
@panic("TODO implement dirStat");
const file: Io.File = .{ .handle = dir.handle };
return fileStat(t, file);
}
const dirStatPath = switch (native_os) {

View file

@ -2009,8 +2009,9 @@ pub const StatError = File.StatError;
/// Deprecated in favor of `Io.Dir.stat`.
pub fn stat(self: Dir) StatError!Stat {
const file: File = .{ .handle = self.fd };
return file.stat();
var threaded: Io.Threaded = .init_single_threaded;
const io = threaded.ioBasic();
return Io.Dir.stat(.{ .handle = self.fd }, io);
}
pub const StatFileError = File.OpenError || File.StatError || posix.FStatAtError;