# std: Fix using fs.Dir.Iterator twice · gitcafe/zig

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

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

Visibility: public

Requested revision: dc11fe4047450167f6b5b2b0e786881b86b3eb27

Requested commit: dc11fe4047450167f6b5b2b0e786881b86b3eb27

Commit: dc11fe4047450167f6b5b2b0e786881b86b3eb27

Tree: 7e25612faf4332948edcc8f165d1dfe9d8c52b04

Author: ominitay

Committer: ominitay

## Message

```
std: Fix using fs.Dir.Iterator twice

This fixes the use of multiple `Iterator`s in a row on a directory.
Previously, on many platforms, using an `Iterator` on an
already-iterated directory would give no entries.

Fixing this involved seeking to the beginning of the directory on the
first call of `next()`.

```

## Parents

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

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