# fs.Dir.deleteTree: Fix FileBusy errors on Windows · gitcafe/zig

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

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

Visibility: public

Requested revision: 063c5f43e9ff6add28ecbbcd79316ede23af3ae8

Requested commit: 063c5f43e9ff6add28ecbbcd79316ede23af3ae8

Commit: 063c5f43e9ff6add28ecbbcd79316ede23af3ae8

Tree: ca767319f252d3eb21868cc09f4d540b0015c418

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
fs.Dir.deleteTree: Fix FileBusy errors on Windows

Windows requires the directory handle to be closed before attempting to delete the directory, so now we do that and then re-open it if we need to retry (from getting DirNotEmpty when trying to delete).

```

## Parents

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

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