fix(libkernel): fail open, stat, lstat, access and unlink through a regular file with ENOTDIR on Windows #8195
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8195"
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:14:38Z.
What
HasNonDirectoryPrefix_nid_no_patchandNotFoundError_nid_no_patch(new, inFilesystemError.hpp, same logic as the static helper inStdio.cpp): when the nearest existing ancestor of the host path is not a directory the not-found error becomes ENOTDIR. Used on the failure path ofsceKernelOpen(OpenNative),sceKernelStat,lstat_nid_postfix,sceKernelUnlinkand the Windowsaccess; no extra host call on success. Remaining calls and the trailing-slash form are not changed; follow-ups for chdir, rename, truncate, chmod, remove, opendir, fopen and utimes are planned as separate PRs by call group.Fixes #8194
Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on upstream/main + this commit:
guest_filesystem: fails without the changes toOpen.cpp,Stdio.cppandFilesystem.cpp, passes with them.guest_path_case,guest_directory,guest_working_directory,guest_fstat_faultandguest_file_vectorpass.python tools/check_conventions.py --base upstream/main: passes.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T02:17:39Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/File/src/Stdio.cppL976-977core/libs/prx/libkernel/File/src/Open.cppL372-373Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/tests/GuestFilesystem.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/tests/GuestFilesystem.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Open.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/tests/GuestFilesystem.cppImported from boykopovar/AnyPS5. Originally posted by droid2299 on 2026-10-20T02:44:51Z.
Independent Windows validation on commit
bbb5b7d2f:guest_filesystem: passedguest_path_case,guest_directory,guest_working_directory,guest_fstat_fault, andguest_file_vector: 5/5 passedgit diff --check HEAD^ HEAD: passedpython tools/check_conventions.py --base HEAD^ --head HEAD: passedThe focused ENOTDIR regression and adjacent filesystem coverage pass for me.