# Make std.fs.cwd\(\) return preopen for "\." if exists · gitcafe/zig

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

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

Visibility: public

Requested revision: 05fb3e79fecc689def1a4186da8783546e17f1ae

Requested commit: 05fb3e79fecc689def1a4186da8783546e17f1ae

Commit: 05fb3e79fecc689def1a4186da8783546e17f1ae

Tree: a39fedbf8e6914fb8a9679324cb2eea02b9c40c2

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
Make std.fs.cwd() return preopen for "." if exists

This commit adds WASI specific impl of `std.fs.cwd()` in which we
emulate the `cwd` behaviour by inquiring the runtime for a "."
preopen if available. This is OK for simple relative ops, but will
not work for any ops which require absolute paths.

```

## Parents

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

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