# fs.deleteFile: Translate to error.IsDir when appropriate on POSIX systems · gitcafe/zig

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

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

Visibility: public

Requested revision: 14c3c47fb7315e6199751082f9ef544972bb13e6

Requested commit: 14c3c47fb7315e6199751082f9ef544972bb13e6

Commit: 14c3c47fb7315e6199751082f9ef544972bb13e6

Tree: b8113e001c2dccc327264923c107467b64cbba9a

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
fs.deleteFile: Translate to error.IsDir when appropriate on POSIX systems

Linux deviates from POSIX and returns EISDIR while other POSIX systems return EPERM. To make all platforms consistent in their errors when calling deleteFile on a directory, we have to do a stat to translate EPERM (AccessDenied) to EISDIR (IsDir).

```

## Parents

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

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