libc: fopen of a directory in a write mode fails with EACCES instead of EISDIR on Windows #8191
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T02:02:50Z.
Repro
Windows host.
fopen("somedir", "w")(also "wb", "r+", "a") and the same throughfreopen.Expected (FreeBSD 11.4
vn_open_vnode, sys/kern/vfs_vnops.c:318-320): EISDIR (21).Actual: EACCES (13), the host CRT's answer. Linux hosts already report EISDIR (core/libs/tests/GuestFopenErrors.cpp, Linux only).
Test:
core/libs/tests/GuestFilesystem.cpp(new cases; fail before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/fopen-directory-write-fb
AI-assisted (Claude Code).