home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
newc_dev
/
ucd.lha
/
UCD
/
UCD.lha
/
UCD.doc
< prev
next >
Wrap
Text File
|
1992-09-17
|
18KB
|
522 lines
UCD v1.0
--------------
A small utility by
Uffe Holst Christiansen.
--------------------------
Copyright (C) Uffe Holst Christiansen, 1992
All rights reserved
Freely distributable
S H A R E W A R E
Author
------
Uffe Holst Christiansen
Kollegiebakken 9, 816
DK 2800 Lyngby
Denmark
Shareware notice
----------------
UCD is shareware and if you use (and hopefully also like it) you have the
moral duty to send me a contribution. The amount I would suggest for a con-
tribution is $10. See later for more information about distribution etc.
Contents at line:
--------
29 - Author
37 - Shareware notice
44 - Contents
72 - UCD - what is it?
85 - Archive UCD.lha contents
96 - Why UCD?
110 - How does UCD work?
124 - The format of UCD.dirs
152 - Usage
157 - How to use it
161 - Create directory structure file
188 - Append to directory structure file
212 - Make directory structure file
266 - Installation of directory structure file
286 - Storing directory structure file
304 - Changing directory
334 - Help
339 - Return codes
346 - Sample files
361 - Additional notes
408 - Limitations
440 - Future updates
475 - Distribution and copyright
500 - Final note
UCD - what is it?
-----------------
UCD is kind of a CD utility capable of doing something the AmigaDOS CD com-
mand not is able to do. It is - like CD - a CLI only utility.
UCD has the ability to change directory to a directory not in the current
directory.
UCD also has the ability of keeping track of the directory structure of more
than one volume at the same time, i.e. you can directly change directory to
a directory in another volume without specifying the volume.
Archive UCD.lha contents
------------------------
The LhA archive contains the following files:
UCD The executable program. This file is imploded.
UCD.doc The documentation file (you're reading it).
UCD.dirs A sample directory structure file containing the
directory structure of my pre-harddrive Workbench.
UCD.make A sample make file to use with the switch -m or -M.
Why UCD?
--------
Everybody knows the Amiga is the PC superior, but unfortunately for us much
very good software is accessible for PCs. Anybody with just a very little
knowledge about PCs have heard of Norton, and maybe even seen an utility
called NCD. What I like best about NCD is it ability to change the directory
to a directory not in the current directory, and I have never come across a
utility capable of exactly that for the Amiga.
And why should the PC have something the Amiga hasn't?
And they should not, and that is the reason for the existence of UCD.
How does UCD work?
------------------
UCD scans the directory structure and stores it in a file called UCD.dirs,
which it places in a UCD directory in RAM:
UCD the uses this directory structure file to locate a directory to change
to.
If you don't want to do a directory structure scan every time you reboot, UCD
can be instructed to store UCD.dirs in SYS:t (NOTE, it will be located in
SYS:t - not in t:). At reboot UCD can be instructed to install this UCD.dirs
in RAM:UCD.
The format of UCD.dirs
----------------------
When scanning the directory structure UCD builds the directory structure file
UCD.dirs which contains the directory structure information needed by UCD.
An example:
Let us assume we in the volume DH0: have the directory devs containing the
subdirectories keymaps, printers and clipboards:
devs (dir)
keymaps (dir)
printers (dir)
clipboards (dir)
Using UCD to create the directory structure file produces the following for
devs and its subdirectories:
devs DH0:devs
keymaps DH0:devs/keymaps
printers DH0:devs/printers
clipboards DH0:devs/clipboards
The actual format is:
<directory><tab><volume:path/directory><new line>
Usage
-----
USAGE: UCD [-<A|a|C|c|d|F|f|h|M|m|s|?>|?] [volume:|dir|file]
How to use it
-------------
Now follows a description of the different possibilities you have with UCD.
-c,-C Create directory structure file
-------------------------------
To create the directory structure file UCD.dirs you use the switch -c
or -C.
USAGE: UCD -c volume:
This will create UCD.dirs for 'volume:'.
USAGE: UCD -C volume:
This will create UCD.dirs for 'volume:' and it will in addi-
tion store UCD.dirs in SYS:t for future use.
Example: UCD -c dh0:
This scans the directory structure for dh0: and stores it in
RAM:UCD/UCD.dirs, it will not be stored in SYS:t. To do that
you must use the switch -C.
Please notice the create switches (-c, -C) will delete an already
existing UCD.dirs in RAM:UCD. The switch -C also deletes UCD.dirs in
SYS:t.
NOTICE: The -C switch will change the file stored in SYS:t.
-a,-A Append to directory structure file
----------------------------------
To append a directory structure to the directory structure file
UCD.dirs you use the switch -a or -A.
USAGE: UCD -a volume:
This appends directory structure information of 'volume:' at
the end of the UCD.dirs currently located in RAM:UCD.
USAGE: UCD -A volume:
This switch will after appending the directory structure in-
formation of 'volume:' on RAM:UCD/UCD.dirs store the directory
structure file in SYS:t.
Example: UCD -A dh1:
This will scan the directory structure for dh1: and appending
it to RAM:UCD/UCD.dirs before storing UCD.dirs in SYS:t.
NOTICE: The -A switch will change the file stored in SYS:t.
-m,-M Make directory structure file
-----------------------------
To make a directory structure file UCD.dirs you use the switch -m
or -M.
This is actually a combination of creating and appending. If you have
an harddrive with for example 5 partitions (DH0: through DH4:) you
normally will have to do the following to make a directory structure
file containing information of all five partitions:
UCD -c DH0:
UCD -a DH1:
UCD -a DH2:
UCD -a DH3:
UCD -A DH4:
Notice I use the switch -A in stead of -a for the last scan. By using
the switches this way I only store UCD.dirs in SYS:t once.
The above process of scanning many partitions is a little bit annoy-
ing if you often have to rescan the directory structure. It could of
course be stored as a batch file.
An easier way is to make a file containing the following information:
DH0:
DH1:
DH2:
DH3:
DH4:
Please notice it is important the file don't contain any additional
spaces, tabs etc. Only new lines between the entries are accepted.
We could for example save the file as s:UCD.make.
Now it is possible to do a scan of all partitions with the command:
UCD -m s:UCD.make
USAGE: UCD -m file
This scans the volumes mentioned in 'file'.
USAGE: UCD -M file
This scans the volumes mentioned in 'file', and will after-
wards store UCD.dirs in SYS:t.
The switches -m and -M will change the UCD.dirs currently located in
RAM:UCD. The -M switch will in addition change the UCD.dirs in SYS:t.
NOTICE: The -M switch will change the file stored in SYS:t.
-s Installation of directory structure file
----------------------------------------
If you after a reboot have the directory structure file located in
SYS:t you install it in RAM:UCD with the switch -s (setup).
USAGE: UCD -s
This installs the UCD.dirs located in SYS:t in RAM:UCD. It is
not possible to use UCD without the directory structure file
installed in RAM:UCD.
Please notice that setting up the UCD system using the switch -s will
delete an already existing UCD.dirs in RAM:t.
It is possible to reinstall the UCD.dirs directory structure file in
SYS:t if you want to. That could maybe be necessary if you have ap-
pended directory structure information of some floppies (using the -a
switch), and no longer want UCD to take effect of this information.
-d Storing directory structure file
--------------------------------
Have you made a directory structure file without storing it in SYS:t
and decide you want to do this, it can be done using the switch -d
(d as in Disk).
USAGE: UCD -d
This stores UCD.dirs located in RAM:UCD in SYS:t.
This is actually the reverse of using the setup switch -s.
Please notice that this will delete an already existing UCD.dirs in
SYS:t.
NOTICE: The -d switch will change the file stored in SYS:t.
-f,-F Changing directory
------------------
Well, changing the directory is actually the purpose of UCD, so how
how do you do that?
USAGE: UCD dir
This will change the directory to 'dir' if 'dir' can be found
in the directory structure file UCD.dirs.
USAGE: UCD -f dir
This will do the same as 'UCD dir', but the -f switch is
necessary if the first character in 'dir' is a dash.
USAGE: UCD -F dir
This will change the directory to 'dir' if 'dir' can be found
in the directory structure file. The difference between the
-F switch and the -f switch is that the -F switch is case sen-
sitive, i.e. 'UCD -F dir' is not the same as 'UCD -F Dir'. The
-f switch will treat 'UCD dir' and 'UCD Dir' as the same di-
rectory to change to.
Example: UCD include
This will in my environment change the directory to 'DH3:lc/
include' whatever the current directory is.
?,-?,-h Help
----
The switches -h, -? or just ? prints a very short help to the screen.
Return codes
------------
Upon success zero is returned. Upon failure one is returned regardless of
type of failure, except the switch -s returns 5 (WARN) upon failure, see the
section with "Additional notes".
Sample files
------------
Two sample files accompany UCD.
The first file UCD.dirs contain the directory structure of my old workbench
disk. The disk was defragmented and reorganized and the directory scan took
20 seconds and had a memory consumption of 30 k. UCD.dirs was made using 'UCD
-c DF1:'. Depending on the fragmentation of the disk, the number of directo-
ries and the number of files a scan can take much longer.
The second file UCD.make is the file I have placed in s: to do a scan of all
my partitions on my harddrive. I use the command 'UCD -m s:UCD.make' to do
the directory structure scan.
Additional notes
----------------
The files UCD.dirs located in RAM:UCD and/or SYS:t is protected from
deletion. The only reason for this is that I always use RAM: for temporary
files and I decided to protect it from deletion so I still can use the syntax
'Delete RAM:* ALL' to delete "all" files in RAM: including subdirectories
without deleting UCD.dirs.
If you want to edit (or delete) UCD.dirs you therefore have to make it
writable:
protect UCD.dirs +wd
I would suggest that you place UCD in c:. If you only have an floppy disk
environment I would suggest you do the following to the startup-sequence:
MakeDir RAM:c
Copy c:UCD RAM:c
Protect RAM:c/UCD -d
Path RAM:c
This will place UCD in RAM:c and as long as you don't have a 'Path c:' before
the 'Path RAM:c' it will load the UCD located in RAM:c in stead of the one
located in c:.
I would suggest that you include something like the following in you startup-
sequence:
Mount RAD:
Dir >NIL: RAD:
UCD -s
If WARN
UCD -m s:UCD.make
UCD -a RAD:
Else
UCD -a RAD:
EndIf
First I mount the recoverable ram drive and redirect the directory of RAD: to
NIL:. Then I setup the UCD system using the switch -s. If UCD.dirs does not
exists in SYS:t UCD returns 5 (WARN) and upon WARN I let UCD scan the wanted
devices using the -m switch and a make file placed in s: and called UCD.make,
and then I scan the directory structure of RAD:. If UCD -s succeeded I just
scan the directory structure of RAD:.
Limitations
-----------
Of course it is very possible you have more than one directory with the same
name located different places on a harddrive. UCD will always choose the
first scanned directory.
This was actually the reason for the -F switch which make it possible
to distinguish two directories with different cases.
You can also decide in which order to scan different volumes and
thereby maybe give one directory a higher priority than another di-
rectory with the same name located on another volume.
It is of course also possible to edit the directory structure file in
an text editor deleting unwanted entries of directories.
UCD does NOT accept wildcards - yet.
Due to some problems with allocating memory UCD uses quite a lot of memory
when scanning the directory structure. My intention was to free it when I no
longer needed it, but (I don't know why) it didn't work. But it will be freed
when the scan (or scans if using -m of -M) are finished.
Scanning my harddrive with five partitions, about 300 directories and
3000 files uses about 220 k of memory and takes less than 45 seconds,
and produces a directory structure file less than 8000 bytes.
NOTICE: It is only the switches -C, -c, -A, -a, -M and -m which have quite a
large memory consumption. The amount of memory needed are dependent
of the number of directories being scanned.
Future updates
--------------
I will in the future try and optimize the code a little and hopefully also
make it a bit shorter. Hopefully I will also be able to figure out why it is
impossible for me to free the allocated memory when I no longer need it.
Luckily it now are freed automatic at exit.
UCD does not support wildcards, but I intend in the near future to include an
ability for wildcards in UCD. Wildcards will really make it much nicer to
with.
Additional things I'm thinking about including:
An ability to setup the UCD system with another directory structure
file than the one in SYS:t (-S).
An ability to append a directory structure file at the in of the
directory structure file currently in RAM:UCD (-(?)).
An ability of storing a directory structure file under another name
than SYS:t/UCD.dirs (-w).
An ability to optimize the directory structure file, i.e. UCD finds
directories mentioned more than once, and removes the unwanted ones
(-O, -o).
An ability of removing directory reference in the directory structure
file (-R, -r).
Well, if a new version of UCD will be placed in the public domain will depend
on the response I receive after having released UCD v1.0. If a new version of
UCD will be placed in the public domain it hopefully will happen through Fred
Fish's public domain library.
Distribution and copyright
--------------------------
UCD may be freely copied and distributed as long as no charges are made other
than to cover the time, copying costs and mailing costs. Please don't distri-
bute UCD without its accompanying doc file. Preferably distribute it along
with its archive UCD.lha or just as the archive.
UCD is copyright Uffe Holst Christiansen, 1992, and it and its accompanying
doc file may not in any way be modified or changed. Archiving and crunching
are allowed.
UCD is shareware, so if you use UCD you have the moral duty to pay the $10
shareware fee.
UCD may be included in a commercial program without written permission from
the author, if a fee of $100 are paid. The doc file still has to accompany
UCD, and no extra charges may be added for the inclusion of UCD in the com-
mercial program.
UCD may be freely distributed on coverdisks, within user groups and it may
freely be included in public domain libraries.
I encourage everybody to distribute UCD.
Final note
----------
I assume no responsibility of damage done to your hardware or software which
the use of UCD may cause. UCD is used totally on your own responsibility.
The above is just for the record. I don't expect UCD to do any damage to
hardware or software. I have used UCD for some time with no problems, and my
harddrive has been scanned at least 100 times and it still works perfectly.
I think a bug with UCD causing a software failure was fixed when I decided
not to try not to free the allocated memory used when scanning.
Please send bug reports, shareware fees and suggestions for future updates of
UCD to:
Uffe Holst Christiansen
Kollegiebakken 9, 816
2800 Lyngby
Denmark
S U P P O R T S H A R E W A R E