# This file is part of Senator Sperma # Licensed under the GPL-3.0 License # Copyright (C) 2026 Salmonik @ salmonik@tuta.io # https://codeberg.org/salmonik/senator-sperma import os import tempfile def get_temp_dir(subdir: str = "senator_sperma") -> str: """Get or create a temp subdirectory. Uses system temp directory (/tmp on Linux, %TEMP% on Windows). OS handles cleanup automatically. """ base_temp = tempfile.gettempdir() temp_path = os.path.join(base_temp, subdir) os.makedirs(temp_path, exist_ok=True) return temp_path