# Dir.readFile/readFileAlloc: take advantage of \`\.allow_directory = false\` on Windows · gitcafe/zig

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

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

Visibility: public

Requested revision: e442a0ecc23d315f99f62684c6240e7c1cb6e9ce

Requested commit: e442a0ecc23d315f99f62684c6240e7c1cb6e9ce

Commit: e442a0ecc23d315f99f62684c6240e7c1cb6e9ce

Tree: 2e034d8953310f01d219f7f65e6cc2db3eea73f8

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
Dir.readFile/readFileAlloc: take advantage of `.allow_directory = false` on Windows

Since we know the read will fail for directories, we can take advantage
of Windows being able to fail with IsDir during open to avoid needing to
wait until the read to find out about the directory-ness of the file.

```

## Parents

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

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