# Windows: Handle ERROR_DIRECTORY in std.fs.deleteDirAbsolute when called on a file path · gitcafe/zig

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

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

Visibility: public

Requested revision: 95a5f6bf2dd822d4a67bef0fda3074dabea2d8c2

Requested commit: 95a5f6bf2dd822d4a67bef0fda3074dabea2d8c2

Commit: 95a5f6bf2dd822d4a67bef0fda3074dabea2d8c2

Tree: ba36dd6774dfa6194626b8204e7d76f845dffabb

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
Windows: Handle ERROR_DIRECTORY in std.fs.deleteDirAbsolute when called on a file path

ERROR_DIRECTORY (267) is returned from kernel32.RemoveDirectoryW if the path is not a directory. Note also that os.DirectDirError already includes NotDir

Before: error.Unexpected: GetLastError(267): The directory name is invalid.
After: error: NotDir

```

## Parents

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

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