Expand description
Game-running guard and transaction logging.
Before launch and before each destructive operation, check whether
Subnautica 2 is running โ the game holds file locks on .sav files
while active.
Constantsยง
- MAX_
LOG_ ๐LINES - Maximum lines before rotation.
Functionsยง
- _game_
running_ ๐linux - Check if Subnautica 2 is running via pgrep (Linux). Dormant.
- available_
space - Estimate free space on the volume containing
pathin bytes. ReturnsNoneon platforms or filesystems where we canโt determine this. - exe_dir ๐
- Return the directory containing the running executable.
- game_
running - Check if Subnautica 2 is currently running (Linux).
- is_
network_ path - Check whether a path looks like a network/UNC path โ for warning purposes.
Matches paths starting with
\\(Windows) or//(Linux). - log_
action - Append a timestamped log entry to
transaction.log. - log_
path - Path to
transaction.loginside thelogs/directory under the platform config root. All timestamped actions are appended here for audit trail purposes. - migrate_
old_ log - Migrate the old
transaction.log(next to the binary) into the newlogs/directory. Appends old entries to the new file, then renames the old file to.migratedso it wonโt be migrated again. Returnstrueif an old log was found and handled. - sanitize_
path - Truncate a filesystem path to start at
Subnautica2/orSubnautica2\, stripping the user-specific prefix for privacy-safe logging.