Showing changes from revision #2 to #3:
Added | Removed | Changed
When an operation on a file is to be acted upon and the full pathname is not explicitly provided, then the FileSwitch module must first search for the file. Two system variables are used to provide a list of file locations to search.
Variable | Description | Default Value |
---|---|---|
File$Path |
Used for read operations only (load, open, update etc…) | Null string |
Run$Path |
Used for execute operations only | ,%. 1 |
1 This searches the current directory first, followed by the library.
The contents of each variable should expand to a list of prefixes, separated by commas.
HardDisc4.$.!boot.Choices.,Resources:$.Resources.Filer.
When a read operation is to be performed, then the prefixes as specified in the File$Path system variable are used to find a matching object. They are scanned in the order as provided by the File$Path, and the first match, either a file or directory is used.
When an execute operation is to be performed, then the prefixes as specified in the Run$Path system variable are used to find a matching object. They are scanned in the order as provided by the Run$Path, and the first match, either a file or directory is used.
Filing system names can be added to the search path of either variable by using the *Set command. An example of two different paths to search on the network, when loading a file is provided below.
*Set File$Path ,%.,Net:Software.,Net:Modules.,Net:Lib*.
This would result in the FileSwitch module looking in the following paths for a given file:
@.file, %.file, Net:Software.file and Net:Modules.file and Net:Lib*.file
Each path in File$Path and Run$Path are checked in turn, in the same order as provided. An illegal pathname will not be used, and will simply be discarded and move to the next path.
The illegal path will, however, not be removed from the variable itself. It will simply not be scanned, as it is an illegal path name.
Path variables may expand to have leading and trailing spaces around elements of the path, and is a valid pathname. Any parsing of path variables need to take this into account.
*Set Run$Path adfs:$. , net:%. , !
is a valid path to search.
Other system variables can be used by an application to set up a list of paths to search. In addition, some SWIs can also allow for alternative path strings to be used to search for a file, or to perform the action without any form of look up.
To assign an alternative path variable, simply use the *Set command.
*Set Photos$Path adfs:$.Photos.,net:$.Photos.
The pseudo filing system could then be accessed as Photos:
A system variable FileSwitch$SpecialField can be used as part of a macro to define a path variable. An example of using this in conjunction with the default definition of Serial$Path is this macro:
devices#<FileSwitch$SpecialField>:$.Serial.
Default values for the serial port can be set, by the following:
devices#baud=9600,bits=8,<FileSwitch$SpecialField>:$.Serial.
Any setting passed to FileSwitch as a special field would then override the defaults in the definition of Serial$Path.