___ _____ / __ __ | \ ___ __ | | | |__) |__) | | | |__) \___ \__/ | \ | \ _|___/ _|_ | \ © 1 9 9 4 S t r a y l i g h t ___________________________________________________________ About CurrDir For some reason, people appear to like to have the current directory in their command prompts. Indeed, I wrote a code variable to do this last November. Following a discussion on c.s.a recently, I decided to upgrade my program for doing this, and then, out of the kindness of my heart, give it away. Nutty, isn't it? So what makes Straylight currDir better than the other current-directory-in-a-code-variable utilities around? Well, for a start, it was written by Straylight. For seconds: * It does it the `right way' by using OS_FSControl 37 (CanonicalisePath) on the string `@' which avoids problems with the mangling-system-variables approach, which can go badly wrong. * It allows you to specify the variable name, so you can have lots of different variables with different options, if you want. * It allows you to specify a `maximum length', beyond which the path name is truncated, so that the path string doesn't fill up the whole width of the screen. The truncation is fairly sensible. It will attempt to show you the filing system and disk name, if there is one, and will chop off the beginning, rather than the end, of the actual pathname, so scsi::Wintermute.$.Straylight.Software.Freeware.Dynamite might be shortened to scsi::Wintermute.$...tware.Free.Dynamite As you have no doubt noticed, an ellipsis (`...') is inserted to show that characters have been removed. ___________________________________________________________ Using currDir At simplest, just double-click on the `currDir' application. This will create a system variable called `CSD' which contains your full current directory path. You could then put in your prompt with a command like SetMacro CLI$Prompt [] If you want to create a different variable, use the `-var' option, e.g.: currDir -var My$Variable If you want to specify a maximum length, use the `-maxLen' option, e.g. currDir -maxLen 40 will ensure that the name never exceeds 40 characters. You can't remove these variables in the normal way -- *Unset will silently ignore your attempts. Therefore currDir has a `-remove' option which you can use, in conjunction with `-var' if necessary, to kill a variable if you don't want it any more. If you're stuck, typing currDir -help will provide you with some addmittedly fairly terse assitance. ___________________________________________________________ Technical details currDir is written as an application since it can safely quit once it has set up the actual code variable. Making it a Utility was a possibility, but that can have the nasty side-effect of fragmenting the module area. It's unlikely you'll want to use it from anything other than the command line, so it shouldn't be that much of a problem. The program needs a little over 2K to run, so as long as you have a page of memory free you won't have any problems there. currDir was written in an evening, using the Acorn ARM Assembler, which is jolly good, and I recommend it. ___________________________________________________________