fix: ramdisk Open no longer opens directory entries

SYS_OPEN succeeded on directory tar entries, so userspace stat() -
which tries open-as-file first - reported every directory as a
regular file. GCC's include-path setup stats each search directory
and rejected all the real ones with "not a directory" warnings.
Directories now fall through Open to -1 and stat() classifies them
via the (recently fixed) ReadDir existence probe.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-07-17 10:13:59 +02:00
co-authored by Claude Fable 5
parent 3938530508
commit aa3b92d834
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -12,4 +12,4 @@
#pragma once
#define MONTAUK_BUILD_NUMBER 20
#define MONTAUK_BUILD_NUMBER 21
+7
View File
@@ -175,6 +175,13 @@ namespace Fs::Ramdisk {
if (path[0] == '/') path++;
for (int i = 0; i < fileCount; i++) {
// Directories are not openable as files. Without this,
// userspace stat() classified every directory with a tar
// entry as a regular file (GCC's include-path setup then
// rejected real directories with "not a directory").
if (fileTable[i].isDirectory) {
continue;
}
if (StrEqual(fileTable[i].name, path)) {
return i;
}