mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.Io.Threaded: implement dirStat
This commit is contained in:
parent
3edce5ea12
commit
d113257d42
2 changed files with 5 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue