18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 08:04:57 +01:00

fix(physicslog): what no file name may have on Windows is replaced in the name of a log, on every system

A spawned vehicle is named <spawn>:<number>, and its log went to physicslog/<spawn>:<number>.dat. On
NTFS that isn't even an error: it is the stream <number>.dat of the file <spawn>, which nothing lists,
so the log was written and no one could find it. On Linux the file was there, under a name Windows
can't open.

The name of the file of a log has < > : " / \ | ? * and the control characters replaced by _, on every
system, so the logs are named alike everywhere (spawn_ezt:12 is spawn_ezt_12.dat), and a _ before a
name Windows keeps for a device (con, nul, com1..., with an extension too). The bytes of 1250 stay.
The black box tells the log it begins by the same name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maj00r
2026-11-16 13:00:16 +01:00
parent 5498995672
commit 0a1c4fd425
5 changed files with 63 additions and 12 deletions

View File

@@ -513,7 +513,7 @@ void blackbox_recorder::keep_tape_line() {
auto const &name{driver->physicslog_name()};
if (m_tapes.insert(name).second) {
PhysicsLogs.begin(name, TController::physicslog_header());
WriteLog(std::format("Black box: the physics log \"physicslog/{}.dat\" begun", name));
WriteLog(std::format("Black box: the physics log \"{}\" begun", PhysicsLogs.shown(name)));
}
PhysicsLogs.append(name, driver->physicslog_line());
}