Skip to main content

Module recording_paths

Module recording_paths 

Source
Expand description

Default output path resolution + “Reveal in Finder/Explorer/Files” plumbing for M-EXPORT.4 (M-RECORD-EXPORT).

Pure-Rust path math + a std::process::Command wrapper for the per-OS file-manager reveal. The user-pickable output directory (M-SAVE.0) layers on top via recorder_settings.

Functions§

default_basename
Compose the extension-less base filename for a session that started at started_at (Unix epoch seconds). Format Screen-YYYY-MM-DD-HHMMSS — sortable, unambiguous, file-system- safe on every OS. M-SAVE.1’s Save panel appends the extension matching the chosen export format.
default_filename
Compose a default output filename for a session that started at started_at (Unix epoch seconds). default_basename + the format’s extension (e.g. Screen-2026-05-25-123700.mp4).
default_output_dir
Default output directory for new recordings. macOS uses ~/Movies/Screen/; Windows + Linux use ~/Videos/Screen/. Honors the SCREEN_RECORDER_OUTPUT_DIR env var for tests and power users.
default_output_path
Compose the full default output path. The directory is created on first use by the encoder; this just returns the path.
ensure_parent_dir
Ensure the parent directory of path exists, creating it recursively if needed. Used by the encoder before opening the scratch files.
move_file
Move src to dst, creating dst’s parent directory first. Used by M-SAVE.1’s MP4 export path to promote the finalized scratch file into the user’s chosen folder.
reveal_in_file_manager
Spawn the per-OS file-manager “reveal this file” command. macOS uses open -R <path>, Windows uses explorer /select,<path>, Linux uses xdg-open <parent-dir> (most distros don’t have a portable “select” verb).
unix_to_ymdhms 🔒
Convert Unix epoch seconds to (year, month, day, hour, minute, second) via a small pure-Rust algorithm. Avoids pulling in chrono for this single-purpose use.