Single colon in Path
Egon Rath (2225) 54 posts |
Hi, can someone please explain what a single colon in a path means? As an example, consider the following command Cat C: This outputs the content of SDFS::HardDisc0.$.AcornC/C++.Export.APCS-32.Lib.clib. Where does this come from and where is it defined? At first i thought it may have something to do with the system variable C$Path which also includes the above path, but has additional directories too, delimated with a comma. Additionally, the CLI is “normally” expanding system variables enclosed with <>. Thanks, |
John Rickman (71) 646 posts |
Doesn’t do that for me. |
David Pitt (3386) 1248 posts |
The trailing colon defines the variable as a path.
*Help Cat ==> Help on keyword Cat *Cat lists all the objects in a directory (default is current directory). Syntax: *Cat [<directory>] * *cat c: Dir. ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib.clib Option 02 (Run) CSD ADFS:"Unset" Lib. ADFS:"Unset" URD ADFS:"Unset" h D/ o D/ * *show c$Path C$Path : ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib.clib.,ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib.tboxlibs.,ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib.c++lib.,ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib.flexlib.,ADFS::Titan4.$.Progm.AcornC/C++.AcornC/C++.Export.APCS-32.Lib. C$Path is set in AcornC/C++.AcornC/C++.!SetPaths.SetPaths Set C$Path <CLIB$Path>,<Lib$Dir>.tboxlibs.,<Lib$Dir>.c++lib.,<Lib$Dir>.flexlib.,<Lib$Dir>. |
Stuart Swales (8827) 1357 posts |
If you have some characters preceding a colon, FileSwitch will first attempt to match it to a registered filing system. If that fails, it then looks up the For the path variable case, FileSwitch may use just the first element of the path (e.g. [David beat me to it!] |
Jeffrey Lee (213) 6048 posts |
C$Path is the right place for you to look. It’s what’s called a “path variable”; if a file path starts with a name and a single colon (e.g. Foo:), then FileSwitch will append “$Path” to the name and look to see if there’s a system variable with the same name (e.g. Foo$Path). If the variable exists, it’s treated as a comma-separated list of paths to search for files in, with each element ending in a dot. E.g. if Foo$Path is defined as SDFS::HardDisc0.$.Bar.,SDFS::HardDisc0.$.Wibble. then trying to access the file Foo:Boop will first look for SDFS::HardDisc0.$.Bar.Boop and then look for SDFS::HardDisc0.$.Wibble.Boop. Note that filesystems can also be accessed using the single-colon syntax – in which case FileSwitch will try looking in the last selected directory for that filesystem (the isn’t a global “currently selected directory” – it’s actually tracked on a per-filesystem basis) [Edit: Wait for a useful answer and then 3 turn up at once] |
Stuart Swales (8827) 1357 posts |
To be fair, path variables aren’t given much coverage in the User Guide. |
Egon Rath (2225) 54 posts |
Thank you very much, makes sense now! |
Rick Murray (539) 13850 posts |
I think Jeffrey’s explanation is more correct, because… you know there’s some twit that will test this.
|
Stuart Swales (8827) 1357 posts |
Ha ha! Looks like it just turned out to be more convenient to evaluate it in that order… |