authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 14:46:23 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 14:46:23 -07:00
log27033332ae95871dd855e118d5525b0e6adb04d4
tree14c639d4d8659d70590171024d963692a1a4ef88
parente3f640cd1353e4fbcfe7598494cdeeff9f3131c8
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

File: add realpath


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

File.zig+10
...@@ -227,3 +227,13 @@ pub fn seekTo(self: File, pos: u64) !void {...@@ -227,3 +227,13 @@ pub fn seekTo(self: File, pos: u64) !void {
227pub fn chmod(self: File, mode: Mode) !void {227pub fn chmod(self: File, mode: Mode) !void {
228 return sys.fchmod(@intFromEnum(self.fd), mode);228 return sys.fchmod(@intFromEnum(self.fd), mode);
229}229}
230
231pub fn realpath(self: File, buf: *[sys.PATH_MAX]u8) ![:0]u8 {
232 return nfs.realdpath(self.fd, buf);
233}
234
235pub fn realpathAlloc(self: File, allocator: std.mem.Allocator) ![:0]u8 {
236 var buf: [sys.PATH_MAX]u8 = undefined;
237 const actual = try self.realpath(&buf);
238 return allocator.dupeZ(u8, actual);
239}