authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-08 00:28:15 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-08 00:28:15 -07:00
logfc341bcc52aebe7acc079179e0b46e231dc43053
tree97776cabfbb0e00444b0811c8f379860cf18ca35
parent29cb44358aabe5d30a3ca2917e4bceaf42fb2aaf
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

add Dir.access()


1 files changed, 11 insertions(+), 0 deletions(-)

Dir.zig+11
...@@ -279,3 +279,14 @@ pub const CreateFlags = packed struct {...@@ -279,3 +279,14 @@ pub const CreateFlags = packed struct {
279 /// The file system mode the file will be created with.279 /// The file system mode the file will be created with.
280 mode: File.Mode = 0o666,280 mode: File.Mode = 0o666,
281};281};
282
283pub fn access(self: Dir, sub_path: [:0]const u8, amode: AccessMode, flag: c_int) !void {
284 return sys.faccessat(@intFromEnum(self.fd), sub_path, @bitCast(amode), flag);
285}
286
287pub const AccessMode = packed struct(c_uint) {
288 readable: bool = false,
289 writable: bool = false,
290 executable: bool = false,
291 _: u29 = 0,
292};