# Fix \`Dir.statFile\` for WASI when linking libc · gitcafe/zig

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

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

Visibility: public

Requested revision: f46008c1d8bce5dd8d1d0155fc3bd1c865870c79

Requested commit: f46008c1d8bce5dd8d1d0155fc3bd1c865870c79

Commit: f46008c1d8bce5dd8d1d0155fc3bd1c865870c79

Tree: 1a41a302fe607ac237ba08ba3e847d434c7fa6d7

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
Fix `Dir.statFile` for WASI when linking libc

`statFile` now only uses `os.fstatatWasi` when not linking libc, matching the pattern used throughout other `Dir` functions. This fixes the compilation error: `error: struct 'c.wasi.Stat' has no member named 'fromFilestat'` (which the added test would have failed with)

```

## Parents

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

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