Introduction
The PathUtils module provides an interface to manipulate system variables used as path variables by FileSwitch. That is, variables ending '$Path' which are used as references to multiple paths in filenames.
SWI calls
R0 | = | Flags:
| ||||||||||||
R1 | = | Pointer to path to process | ||||||||||||
R2 | = | Pointer to output buffer | ||||||||||||
R3 | = | Maximum length of the buffer, or 0 to request length | ||||||||||||
R4 | = | Opaque context value, or 0 for the first call |
R0 - R2 | preserved | |
R3 | = | Number of spare bytes in the buffer |
R4 | = | Context value, or -1 if complete (and the other registers are invalid) |
R5 | = | Variable type that the value was expanded from |
R6 | = | Depth the value was expanded from |
This SWI is used to enumerate the components of a path variables. The path variable is expanded recursively. If R0 bit 0 is set, each path component will be returned in the results, even it is not terminal itself.
R0 | = | Flags:
| ||||||||||||
R1 | = | Pointer to variable name to modify | ||||||||||||
R2 | = | Pointer to path component to join |
R0 - R2 | preserved |
This SWI is used to join a path to an existing path variable. If the component already exists in the path variable, it will not be added.
R0 | = | Flags:
| ||||||
R1 | = | Pointer to variable name to modify | ||||||
R2 | = | Pointer to path component to remove |
R0 - R2 | preserved |
This SWI is used to remove a path from an existing path variable. If the component is not present, the variable will not be modified.
*Commands
<path-variable> | - | name of the path variable to append to |
<path-component> | - | name of the path to append to the variable |
This command appends a given path component to a path variable. If the path is already present, it has no effect.
<path-variable> | - | name of the path variable to append to |
<path-component> | - | name of the path to insert at the start of the path variable |
This command prepends a given path component to a path variable, inserting the path at the start of the variable's value. If the path is already present, it has no effect.
<path-variable> | - | name of the path variable to change |
<path-component> | - | name of the path to remove from the path variable |
This command removes a given path component from a path variable. If the variable is not present, the variable is not changed.