Expand description
SURJECTION_HOME resolution, data layout and sync-root detection (SPEC 4.5).
Structs§
- Surjection
Home - The resolved data directory.
- Sync
Root - A sync folder containing a path. Reported by
surject doctorassync_root_detected.
Enums§
- Home
Source - Where the resolved
SURJECTION_HOMEcame from, highest precedence first. - Sync
Root Kind - 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
HOMEon Windows: the profile comes fromEnv::homeand the base fromFOLDERID_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 pastMAX_PATH(SPEC 16.1):C:\xis\\?\C:\x,\\server\share\xis\\?\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, orLOADOUT_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 loadoutmoves). - normalize
- Lexically normalizes a path: drops
.and resolves..against earlier components without touching the file system...above a root is dropped. - plain
pathwithout a\\?\prefix (extendedundone):\\?\C:\xisC:\x,\\?\UNC\server\share\xis\\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 theSURJECTION_HOMEvariable, else the formerLOADOUT_HOMEvariable, else the per-OS default. Overrides must be absolute. The result is checked for an enclosing sync folder.