Zig Version
0.17.0-dev.9+046002d1a
Steps to Reproduce and Observed Behavior
zig run this code
conststd=@import("std");pubfnmain(init:std.process.Init)!void{varbuf:[std.Io.Dir.max_path_bytes]u8=undefined;constcwd=std.Io.Dir.cwd();_=trycwd.realPath(init.io,&buf);}
Observed a runtime error:
error: FileNotFound
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Threaded.zig:6862:39: 0x1186830 in realPathPosix (std.zig)
.NOENT => return error.FileNotFound,
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Threaded.zig:6774:5: 0x119e926 in dirRealPathPosix (std.zig)
return realPathPosix(dir.handle, out_buffer);
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Dir.zig:913:5: 0x11f112e in realPath (std.zig)
return io.vtable.dirRealPath(io.userdata, dir, out_buffer);
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/main.zig:6:9: 0x11eab77 in main (main.zig)
_ = try cwd.realPath(init.io, &buf);
^
Expected Behavior
For std.Io.Dir.realPath to not return error.FileNotFound, but instead, to write the absolute path of cwd to buf and return the number of bytes written.
### Zig Version
0.17.0-dev.9+046002d1a
### Steps to Reproduce and Observed Behavior
`zig run` this code
```zig
const std = @import("std");
pub fn main(init: std.process.Init) !void {
var buf: [std.Io.Dir.max_path_bytes]u8 = undefined;
const cwd = std.Io.Dir.cwd();
_ = try cwd.realPath(init.io, &buf);
}
```
Observed a runtime error:
```
error: FileNotFound
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Threaded.zig:6862:39: 0x1186830 in realPathPosix (std.zig)
.NOENT => return error.FileNotFound,
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Threaded.zig:6774:5: 0x119e926 in dirRealPathPosix (std.zig)
return realPathPosix(dir.handle, out_buffer);
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/lib/std/Io/Dir.zig:913:5: 0x11f112e in realPath (std.zig)
return io.vtable.dirRealPath(io.userdata, dir, out_buffer);
^
/home/dani/Downloads/zig-x86_64-linux-0.17.0-dev.9+046002d1a/main.zig:6:9: 0x11eab77 in main (main.zig)
_ = try cwd.realPath(init.io, &buf);
^
```
### Expected Behavior
For std.Io.Dir.realPath to not return error.FileNotFound, but instead, to write the absolute path of cwd to buf and return the number of bytes written.