# Add std.os.getFdPath and std.fs.Dir.realpath · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/3e2e6baee568b0fb9d019fc53974aad30386b824)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 3e2e6baee568b0fb9d019fc53974aad30386b824

Requested commit: 3e2e6baee568b0fb9d019fc53974aad30386b824

Commit: 3e2e6baee568b0fb9d019fc53974aad30386b824

Tree: 432202df308ca46ee7f8d26c5021eecdea07cca5

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
Add std.os.getFdPath and std.fs.Dir.realpath

`std.os.getFdPath` is very platform-specific and can be used to query
the OS for a canonical path to a file handle. Currently supported hosts
are Linux, macOS and Windows.

`std.fs.Dir.realpath` (and null-terminated, plus WTF16 versions) are
similar to `std.os.realpath`, however, they resolve a path wrt to this
`Dir` instance.

If the input pathname argument turns out to be an absolute path, this
function reverts to calling `realpath` on that pathname completely
ignoring this `Dir`.

```

## Parents

- [e043396b242d727cd72fecda265bd4b78a86958a](https://git.cafe/gitcafe/zig/commit/e043396b242d727cd72fecda265bd4b78a86958a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/3e2e6baee568b0fb9d019fc53974aad30386b824?format=markdown)
