mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.Io.Threaded: implement dirStat
This commit is contained in:
parent
89bda60d28
commit
81214278ca
2 changed files with 5 additions and 5 deletions
|
|
@ -1650,9 +1650,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) {
|
||||
|
|
|
|||
|
|
@ -2008,8 +2008,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
Add a link
Reference in a new issue