Skip to main content

Module paths

Module paths 

Source
Expand description

SURJECTION_HOME resolution, data layout and sync-root detection (SPEC 4.5).

Structs§

SurjectionHome
The resolved data directory.
SyncRoot
A sync folder containing a path. Reported by surject doctor as sync_root_detected.

Enums§

HomeSource
Where the resolved SURJECTION_HOME came from, highest precedence first.
SyncRootKind
File-sync tool owning a folder. Live git repos and lock files must not live inside one.

Constants§

STATE_DIR
The machine-local state directory inside SURJECTION_HOME.

Functions§

default_surjection_home
The per-OS default data directory. Never reads HOME on Windows: the profile comes from Env::home and the base from FOLDERID_LocalAppData.
detect_sync_root
Finds a file-sync folder containing path.
extended
The \\?\ (extended-length) form of an absolute Windows path, which file system calls accept past MAX_PATH (SPEC 16.1): C:\x is \\?\C:\x, \\server\share\x is \\?\UNC\server\share\x. The path is normalized first, since the OS takes a \\?\ path literally (no /, . or .. handling). Any other path, and every path off Windows, is returned as it is.
home_var
The data folder variable in effect and its value: SURJECTION_HOME, or LOADOUT_HOME (Loadout 1.0.x) when the former is unset.
legacy_default_home
The per-OS default data directory of Loadout 1.0.x (what surject migrate loadout moves).
normalize
Lexically normalizes a path: drops . and resolves .. against earlier components without touching the file system. .. above a root is dropped.
plain
path without a \\?\ prefix (extended undone): \\?\C:\x is C:\x, \\?\UNC\server\share\x is \\server\share\x. Any other path, and every path off Windows, is returned as it is.
surjection_home
Resolves SURJECTION_HOME: flag (the CLI --home), else the SURJECTION_HOME variable, else the former LOADOUT_HOME variable, else the per-OS default. Overrides must be absolute. The result is checked for an enclosing sync folder.