Skip to main content

Module platform

Module platform 

Source
Expand description

Operating-system specifics behind one interface: owner-only files and directories, scoped opens and listings that never follow a link, process trees held until admitted, stop signals, hidden terminal input, and host details.

Unix uses modes, openat with O_NOFOLLOW, /proc, and process groups. Windows uses protected owner-only DACLs, handle-relative opens that refuse every reparse point, and kill-on-close Job Objects.

Kept as is (#201): process-wrap 10.0.1 is used for Unix process groups, but its Windows JobObject assigns a job after spawning and waits for the whole job, not just the leader. It exposes neither creation-time job assignment nor our separately owned admission gate; keep the current suspended-spawn/assignment and detached-launch policy on Windows. rpassword 7.5.4 exposes blocking password reads, not a caller-owned mode guard that can restore the terminal when a pending read is cancelled. Keep the echo-only guard and the bounded stdin reader; its restoration contract is tested in hidden_input. Program lookup and desktop-opener crate choices are documented in artifactize-tools’ platform module, where those implementations live.

Modules§

desktop_commands
Desktop-only command registration. OS paths, login shells and elevation stay here.
environment
The process environment, read in one place: variable lookup, which ignores the case of names on Windows, snapshots handed to children, and lookups in such snapshots. Every child gets a snapshot, never this process’s environment by inheritance.

Structs§

HiddenInput
Turns terminal echo off until dropped, so a pasted secret is not shown.

Constants§

VISIBLE_INPUT_FALLBACK
Whether a terminal that cannot hide input is still read, visibly, after a warning. A Unix terminal always can; failing to hide input is an error.

Functions§

open_nonblocking
Open for reading without blocking on a FIFO, so its type can be checked first.
open_regular
Open an existing regular file for reading without following a link in its last component (on Windows, any reparse point), and check what was opened.
path_text
Render a native path for people and JSON clients with portable / separators.
pause_after_help
Only a no-argument desktop launch with console input AND output may wait for Enter.
stop_requested
Register for SIGINT and SIGTERM now; the future completes at the first of them.