Get directory's path

Hi, I’m upgrading a project to Zig 0.16 and I wonder how to get a directory’s path.
Before, I used std.os.getFdPath with dir’s fd field, but this function disappeared.
I want to use the realPath* functions on Dir type but they are all commented with It is generally advisable to avoid this function entirely.
So what’s a recommended way to get a directory’s path?
Thanks!

If you can redesign your app to pass both path and the dir fd, you will have a much better system. The fd to path operation is not well supposed across operating systems.

2 Likes