diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-23 13:07:27 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 06:54:36 -0500 |
| commit | 297ad8685486dc9523d492e8fce19ae4aa52429b (patch) | |
| tree | 8c6dd4aebf02ba920e9d77a4bcae73dab11c8cd0 /runtime/src/main.cpp | |
| parent | 21625bca8c675c62f9dbffc318ce6a59d57faf31 (diff) | |
file_system: T: is a folder of each process's own in the overlay
T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and
kept between runs. The title makes its crash dump and crash log there
with CREATE_NEW, and a name an earlier run (or a second process) had
left failed with ERROR_FILE_EXISTS (80), so no report landed (old
upstream issue 7913, measured by Spacecer2 under Wine 11.22).
T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the
process's start time in UTC and its id, made on the first T: call. The
start time keeps a reused process id (Wine hands each fresh prefix the
same small ids) out of an old run's folder. T:\.. cannot climb into the
shared folder, T:\ itself still cannot be removed or moved, and earlier
runs' folders are kept so their crash files can be read. GAME: and G:
are unchanged.
rt::fs::scratch_dir() returns the folder, and the startup line names it:
"console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake
checks of that line (run_tiny_game_console_paths, run_tiny_game_dir)
and the synthetic test of the first now expect the T: part.
file_system_test: a CREATE_NEW of a name earlier runs left in
.gta6rt-temp succeeds and lands in the process's own folder; the folder
is stable for the process; a second process (the test started again)
creating the same name on the same overlay succeeds in a folder of its
own; GAME: reads and writes are unchanged. On main these fail with
ERROR_FILE_EXISTS (80), in this process and in the second one.
Restored from old upstream PR 8161 and ported onto the new main: the
folder is made through main's win32_io_path, so long overlay roots keep
working, and the scratch-folder check of the write-open path is kept.
Main's long-overlay T: check now finds scratch.bin in the process's own
folder below .gta6rt-temp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 098a8ee40..900b8460a 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -254,7 +254,9 @@ int wmain(int argc, wchar_t** argv) { | |||
| 254 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); | 254 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); |
| 255 | return 1; | 255 | return 1; |
| 256 | } | 256 | } |
| 257 | const std::wstring paths = L"console paths: GAME: -> " + game_dir.native() + L", writes -> " + overlay_dir.native(); | 257 | const std::filesystem::path scratch_dir = rt::fs::scratch_dir(); |
| 258 | const std::wstring paths = L"console paths: GAME: -> " + game_dir.native() + L", writes -> " + | ||
| 259 | overlay_dir.native() + L", T: -> " + scratch_dir.native(); | ||
| 258 | const HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); | 260 | const HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); |
| 259 | DWORD mode; | 261 | DWORD mode; |
| 260 | bool printed = false; | 262 | bool printed = false; |
| @@ -267,8 +269,10 @@ int wmain(int argc, wchar_t** argv) { | |||
| 267 | if (!printed) { | 269 | if (!printed) { |
| 268 | const auto game = game_dir.u8string(); | 270 | const auto game = game_dir.u8string(); |
| 269 | const auto overlay = overlay_dir.u8string(); | 271 | const auto overlay = overlay_dir.u8string(); |
| 270 | std::printf("console paths: GAME: -> %s, writes -> %s\n", | 272 | const auto scratch = scratch_dir.u8string(); |
| 271 | reinterpret_cast<const char*>(game.c_str()), reinterpret_cast<const char*>(overlay.c_str())); | 273 | std::printf("console paths: GAME: -> %s, writes -> %s, T: -> %s\n", |
| 274 | reinterpret_cast<const char*>(game.c_str()), reinterpret_cast<const char*>(overlay.c_str()), | ||
| 275 | reinterpret_cast<const char*>(scratch.c_str())); | ||
| 272 | } | 276 | } |
| 273 | std::printf("running %s\n", main_module.name.c_str()); | 277 | std::printf("running %s\n", main_module.name.c_str()); |
| 274 | std::fflush(stdout); | 278 | std::fflush(stdout); |