From aa3b92d834b3bc2904e612307be990a3e3e8c695 Mon Sep 17 00:00:00 2001 From: Daniel Hammer Date: Fri, 17 Jul 2026 10:13:59 +0200 Subject: [PATCH] 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 --- kernel/src/Api/BuildNo.hpp | 2 +- kernel/src/Fs/Ramdisk.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/src/Api/BuildNo.hpp b/kernel/src/Api/BuildNo.hpp index 4a8b1ef..feb58dc 100644 --- a/kernel/src/Api/BuildNo.hpp +++ b/kernel/src/Api/BuildNo.hpp @@ -12,4 +12,4 @@ #pragma once -#define MONTAUK_BUILD_NUMBER 20 +#define MONTAUK_BUILD_NUMBER 21 diff --git a/kernel/src/Fs/Ramdisk.cpp b/kernel/src/Fs/Ramdisk.cpp index 2b15fd0..6c91998 100644 --- a/kernel/src/Fs/Ramdisk.cpp +++ b/kernel/src/Fs/Ramdisk.cpp @@ -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; }