home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
misc
/
csdvarmod_1
/
ReadMe
< prev
Wrap
Text File
|
1996-02-18
|
4KB
|
75 lines
CSDVar Module, V1.00 © Musus Umbra, 1996
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do you sometimes wish that Risc OS had the 'Prompt $P' functionality of
DOS? Do you find it tricky remembering where you are in a directory
tree when using the command line? Ever wanted the unix 'pwd' command?
Then CSDVar is for you!
What is it?
~~~~~~~~~~~
CSDVar is a (tiny) module that has 3 main functions:
(1) It provides a *command, 'pwd' that prints out the full pathname
of the current directory.
(2) It provides 1 SWI, CSDVar_ReadCSD (&CD0C0) that reads the full
pathname of the CSD and returns a pointer to it.
(3) It provides a system variable, CSD$Var that whenever inspected
will hold the full pathname of the CSD. This is the main reason
I wrote the module, the rest is all just gloss.
How to use it
~~~~~~~~~~~~~
Probably the best and simplest use is to load the module in your boot
sequence, and then issue a
*SetMacro CLI$Prompt <CSD$Var> *
command. Now, whenever you'd normally be presented with a '*' prompt on the
command line, you'll instead have the full pathname of the CSD displayed, and
then the *. I find this incredibly useful, since I'm always using taskwindows,
or ducking out of the desktop (F12) to do some command line stuff, and I often
need to keep track of where I am in the directory tree.
But I already have something that does that!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So did I, but the utility I was using had (at least) one fundamental problem,
if the CSD's pathname couldn't be read, it caused an endless string of error
messages, necessitating a reboot. CSDVar doesn't do that, instead it will
tell you what the error was instead of the CSD's pathname. Try it on ADFS::0
without a disc in the drive and you'll see what I mean. The utility I was
using would have spewed continuous 'Drive empty' messages at me until I'd
appeased it by putting a disc in the drive. CSDVar will just say 'Drive empty'
once and be done with it. Much better.
Background
~~~~~~~~~~
Basically, I'd been using a similar utility to set the CLI prompt to the
name of the CSD, but I'd got increasingly upset with it. The principal
problem was that if the CSD couldn't be read for some reason (eg. I'd changed
to IDEFS, but my IDE drive is disconnected now that I have a bigger, faster
SCSI drive) and there was an error, I'd get an endless stream of (for
instance) 'Bad Drive's appearing when I hit F12, and the only option would be
a re-boot. Now, why the Hell didn't whoever wrote the utility I was using
simply trap the error and use that for the name of the CSD in the system
prompt? I don't know, but that's exactly what my module does. Also, my module
will allow you to 'unset' the system variable it provides - not fantastically
useful, but if for some arcane reason you want to, you can.
Disclaimer
~~~~~~~~~~
Use of this software is completely at your own risk. The author can accept no
responsibility for any damage/loss arising from the use, or inability to use
this software. No warranty, express or implied, applies to this software.
This is not PD: the Copyright in this software belongs at all times to the
author. However, permission is granted for unrestricted distribution
prodividing that *no* charge is made for the distribution [a charge may be made
for handling/media] and that the whole of the software is supplied intact and
unaltered. Permission is also granted for unrestricted use and alteration of
the software [but if you fix a bug / add anything nice, let me know so I can
patch the 'master' version].
Bug reports / comments / etc to:
Musus Umbra c/o 23 Baronsway, Whitkirk, Leeds, LS15 7AW, England.
(until Sept-ish '96: n0ae3@newton.ncl.ac.uk)