diff --git a/Dir.zig b/Dir.zig index 3cfb13660b921f431c4123f943af3d4b9c5e0808..75d0898e18788e4394c5fddc6ffbc23bf5e1f267 100644 --- a/Dir.zig +++ b/Dir.zig @@ -279,3 +279,14 @@ pub const CreateFlags = packed struct { /// The file system mode the file will be created with. mode: File.Mode = 0o666, }; + +pub fn access(self: Dir, sub_path: [:0]const u8, amode: AccessMode, flag: c_int) !void { + return sys.faccessat(@intFromEnum(self.fd), sub_path, @bitCast(amode), flag); +} + +pub const AccessMode = packed struct(c_uint) { + readable: bool = false, + writable: bool = false, + executable: bool = false, + _: u29 = 0, +};