From 1da99a0671b2185226bccabee820874aafff9b48 Mon Sep 17 00:00:00 2001 From: nmzik Date: Tue, 4 Aug 2026 02:23:36 +0200 Subject: [PATCH] Add warning for Windows-forbidden filename characters --- src/kernel/fileSystem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/kernel/fileSystem.cpp b/src/kernel/fileSystem.cpp index 2c42025..b7cd020 100644 --- a/src/kernel/fileSystem.cpp +++ b/src/kernel/fileSystem.cpp @@ -276,6 +276,10 @@ static std::filesystem::path ResolvePathIgnoringCase(const std::filesystem::path return resolved; } +#else +static bool HasWindowsForbiddenFilenameCharacter(const std::string& relative_path) { + return relative_path.find_first_of("<>:\"|?*") != std::string::npos; +} #endif std::filesystem::path MountPoints::GetRealFilename(const std::string& mounted_file_name) { @@ -295,6 +299,10 @@ std::filesystem::path MountPoints::GetRealFilename(const std::string& mounted_fi rel_path = Common::RemoveFirst(rel_path, 1); } #if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS + if (HasWindowsForbiddenFilenameCharacter(rel_path)) { + ::printf("FileSystem: Windows-incompatible guest filename: %s\n", + mounted_file_name.c_str()); + } return p.dir / rel_path; #else return ResolvePathIgnoringCase(p.dir / rel_path);