Initial revision
[ssr] / StraySrc / MiscToys / CurrDir / README
1 ___ _____
2 / __ __ | \ ___ __
3 | | | |__) |__) | | | |__)
4 \___ \__/ | \ | \ _|___/ _|_ | \
5
6 © 1 9 9 4 S t r a y l i g h t
7 ___________________________________________________________
8
9 About CurrDir
10
11 For some reason, people appear to like to have the current
12 directory in their command prompts. Indeed, I wrote a code
13 variable to do this last November. Following a discussion
14 on c.s.a recently, I decided to upgrade my program for
15 doing this, and then, out of the kindness of my heart, give
16 it away. Nutty, isn't it?
17
18 So what makes Straylight currDir better than the other
19 current-directory-in-a-code-variable utilities around?
20 Well, for a start, it was written by Straylight. For
21 seconds:
22
23 * It does it the `right way' by using OS_FSControl 37
24 (CanonicalisePath) on the string `@' which avoids
25 problems with the mangling-system-variables approach,
26 which can go badly wrong.
27
28 * It allows you to specify the variable name, so you can
29 have lots of different variables with different options,
30 if you want.
31
32 * It allows you to specify a `maximum length', beyond which
33 the path name is truncated, so that the path string
34 doesn't fill up the whole width of the screen.
35
36 The truncation is fairly sensible. It will attempt to show
37 you the filing system and disk name, if there is one, and
38 will chop off the beginning, rather than the end, of the
39 actual pathname, so
40
41 scsi::Wintermute.$.Straylight.Software.Freeware.Dynamite
42
43 might be shortened to
44
45 scsi::Wintermute.$...tware.Free.Dynamite
46
47 As you have no doubt noticed, an ellipsis (`...') is
48 inserted to show that characters have been removed.
49 ___________________________________________________________
50
51 Using currDir
52
53 At simplest, just double-click on the `currDir'
54 application. This will create a system variable called
55 `CSD' which contains your full current directory path. You
56 could then put in your prompt with a command like
57
58 SetMacro CLI$Prompt [<CSD>]
59
60 If you want to create a different variable, use the `-var'
61 option, e.g.:
62
63 currDir -var My$Variable
64
65 If you want to specify a maximum length, use the `-maxLen'
66 option, e.g.
67
68 currDir -maxLen 40
69
70 will ensure that the name never exceeds 40 characters.
71
72 You can't remove these variables in the normal way --
73 *Unset will silently ignore your attempts. Therefore
74 currDir has a `-remove' option which you can use, in
75 conjunction with `-var' if necessary, to kill a variable if
76 you don't want it any more.
77
78 If you're stuck, typing
79
80 currDir -help
81
82 will provide you with some addmittedly fairly terse
83 assitance.
84 ___________________________________________________________
85
86 Technical details
87
88 currDir is written as an application since it can
89 safely quit once it has set up the actual code variable.
90 Making it a Utility was a possibility, but that can have
91 the nasty side-effect of fragmenting the module area. It's
92 unlikely you'll want to use it from anything other than the
93 command line, so it shouldn't be that much of a problem.
94 The program needs a little over 2K to run, so as long as
95 you have a page of memory free you won't have any problems
96 there.
97
98 currDir was written in an evening, using the Acorn ARM
99 Assembler, which is jolly good, and I recommend it.
100 ___________________________________________________________