| ... | @@ -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 | |
| | 283 | pub 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 | |
| | 287 | pub const AccessMode = packed struct(c_uint) { |
| | 288 | readable: bool = false, |
| | 289 | writable: bool = false, |
| | 290 | executable: bool = false, |
| | 291 | _: u29 = 0, |
| | 292 | }; |