7.8 Relative, absolute and Windows paths
Path resolution follows the source of the path. Paths read from a settings file are resolved against the directory containing that file. CLI paths are resolved from the process working directory. Absolute paths remain absolute.
Suppose project/config/design.power contains:
[input]
control_stream = "../model/final.ctl"
The referenced file is project/model/final.ctl, even if nlmx is launched from another directory. This rule makes a configuration bundle movable as a unit.
By contrast:
nlmx power project/model/final.ctl -c project/config/design.power
interprets the positional path from the shell's current directory. Record that directory in automation or convert the invocation path to an absolute path.
Nested references
A control stream can itself refer to a dataset with $DATA. That dataset path follows the control-stream rules documented in Chapter 5, not necessarily the settings file's directory. Think in edges: each referring artifact establishes the base for its own relative references.
Windows details
Both slash styles can work at the filesystem layer, but TOML string rules apply first. Prefer forward slashes inside double quotes, or single-quoted literal strings for backslashes. Drive-qualified paths and UNC paths are machine-specific and reduce portability. Case-insensitive local behavior should not be relied on when moving a bundle to a case-sensitive filesystem.
Output paths
An output directory supplied on the CLI follows the CLI base. One read from a file follows the file base. nlmx protects non-empty output directories unless overwriting is explicitly requested and refuses unsafe destinations such as the model directory in protected workflows. Use a new run directory rather than weakening these checks.
Common mistakes
- Resolving every relative path from the shell directory.
- Forgetting that
$DATAis referenced by the control stream. - Using unescaped backslashes in a basic TOML string.
Checklist
- Identify the artifact that owns each relative path.
- Test the project from a second working directory.
- Avoid machine-specific absolute paths in committed settings.
Further reading
See portable layouts, TOML strings and Chapter 5 for control-stream data paths.