Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › Io/ › Threaded.zig › statFromWasi
statFromWasi
Threaded.statFromWasi
fn statFromWasi (st : *const std .os .wasi .filestat_t ) File .Stat
File
Code
fn statFromWasi (st : *const std .os .wasi .filestat_t ) File .Stat {
return .{
.inode = st .ino ,
.nlink = st .nlink ,
.size = @bitCast (st .size ),
.permissions = .default_file ,
.kind = switch (st .filetype ) {
.BLOCK_DEVICE => .block_device ,
.CHARACTER_DEVICE => .character_device ,
.DIRECTORY => .directory ,
.SYMBOLIC_LINK => .sym_link ,
.REGULAR_FILE => .file ,
.SOCKET_STREAM , .SOCKET_DGRAM => .unix_domain_socket ,
else => .unknown ,
},
.atime = .fromNanoseconds (st .atim ),
.mtime = .fromNanoseconds (st .mtim ),
.ctime = .fromNanoseconds (st .ctim ),
.block_size = 1 ,
};
}