home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
455.lha
/
finddisk_v3.1
/
FindDisk2.doc
< prev
next >
Wrap
Text File
|
1990-12-10
|
9KB
|
262 lines
FindDisk2.2
A Public Domain Program by Ross MacGregor.
The source was compiled with the Manx compiler.
(but can be compiled with Lattice with a small effort)
/* Anxious? Then skip ahead to Getting Started. */
Most people that own Amiga's soon accumulate a *GREAT* collection of
3-&-1/2 '' disks filled with lots and lots of PD software. And I'm sure
that many people still go through the same time-consuming process I use to
when finding a certain program [ I think it's on this disk...no maybe this
one...lets try this one...it must be here...I guess not...argggh! $#@#%! ].
If you have been looking to organize your disks a little better, this may
be just what you need. I have seen other disk cataloging programs but
they looked BIG and complicated.
I wanted a simple, unintrusive CLI command that would tell me on what disk
such-n-such a program could be found.
So here it is, (ta-da) FD for FindDisk of course (now vers 2.2) .
I made extensive revisions to how it operates and hope it is now much
easier to use.
Type> FD ; And you will get a summary of available commands
Type> FD text ; And the disk's directory listing containing 'text'
is displayed just as if you had done an ls df0:.
The text could also be the name of the disk.
Multiple arguments can also be given so that the
directory, ARP_COMMANDS_DOC could be found with,
FD doc arp.
The DiskList
FD uses a file which by default is called DiskList and is contained in
the directory df0:FindDisk. This is an almost ASCII file containing
the listings of your disks.
[clarification of almost...]
To save space the listings are stored with the spaces ($20's) compacted
and some words of the listing tokenized.
This results in a file with many special (non-standard) control
characters. It will not TYPE properly!
The DiskList can be loaded to ram: (yes, it's just a COPY but its also an
FD command, FD -load ). This enables single drive users to capture the
dir listings of other disks. It frees up the drive and also speeds
things up if the DiskList gets large.
TempDL
When you capture the directory listing of a disk (FD -dir) it goes to an
intermediate file, TempDL, instead of going directly to DiskList
(basically it's a Shell> dir >>TempDL ). This is for reasons of more
efficient updating of the DiskList. If someone had many disks to do,
inserting the directories into DiskList one at a time would take much
longer than inserting them all at once as FD does. Single drive users
would also need to reinsert their DiskList disk after each FD -d. You
must do an FD -update or FD -savedl to update the DiskList.
FD -update will update the current DiskList. If DiskList was loaded to
ram: the current one is considered there, otherwise it updates the disk
DiskList.
FD -savedl will copy the ram:DiskList to its disk location after doing
an update (as above). If the current DiskList is not in RAM it will only
do an update.
FindDisk2.2
---------------
Syntax : FD <-l> | <-s> | <-u> | <-r volname> |
<-d [path]> | <-a [path]> | <-n> |
<[!]text1 [!]text2 ... [!]textn>
> fd -l Loads DiskList to ram: by default or to an alternate
path/name if specified by the environment variable DLTEMP .
The DiskList in RAM then becomes the current DiskList.
DiskList must be now be saved to disk (FD -save) if any
changes are made because FD -update will only update the
RAM DiskList.
> fd -d [path]
To add a disk listing to the DiskList. Appends in
ram:TempDL the ASCII (root) dir listing of the disk in
drive DF0: by default. It takes it from an alternate drive
if specified by the environment variable DLDISK. You can
now also specify drive or directory path as a second
argument to fd.
> fd -a [path]
Same as above but captures sub-directories also (all of the
disk).
> fd -u FD with the u option will update the current DiskList with
the contents of the temporary file TempDL.
> fd -s Does an update (as above) then, if the DiskList is in RAM,
it is copied to its disk location. DiskList and TempDL are
removed from RAM.
> fd -n Creates a new DiskList, by deleting the contents of the
Current DiskList.
> fd -r diskname
This will remove the disk listing in DiskList that matches 'diskname'.
> fd arg1 arg2 ... argn
If the arguments for FD are all found on the same line of a directory
listing in the DiskList then that dir listing is printed.
If the search text is preceded with an ! with no spaces in between
then the search is case sensitive otherwise it is not.
The disk name can also be used to list its contents.
Environment Variables
---------------------
You should have env: assigned before invoking FD or else you will get an
annoying requester asking to insert volume env:. Env: can be ASSIGN'ed
to RAM: if you do not want to create the standard ram:env directory.
[ Yes, this could have been circumvented but at the expense of larger
code! I opted not to add it since assigning env: from the CLI is a
trivial matter. ]
FD will check for the three environment variables listed below.
*Notice* that DLDISK and DLTEMP require the name of DiskList also!
Variable = Default setting if not specified.
DLDISK = FindDisk:Disklist
------
Disk storage location/name. This is where FD expects to find
the permanent DiskList. It must be on a floppy or hard drive.
DLTEMP = ram:DiskList
------
Ram storage location/name. This is where FD will copy the
permanent DiskList to on an FD -load. This makes the DiskList
resident and frees up the drive.
DLDRIVE = df0:
-------
Captures dir of this drive on a FD -dir command.
Getting Started
---------------
With this disk in drive df0: (this can be changed with an env. variable)
Type> fd
Hopefully this help screen provided will be all you ever need to refer
to in the future.
Type> fd :
This displays all disks in the DiskList [if there is an example one
provided]. It displays all of them because there is always a colon in
every volume name.
Type> fd -l
The DiskList will be loaded to ram:.
Type> fd -n
Respond 'y' to the prompt. Now you have a new (empty) DiskList in ram:.
Place any disk in drive df0:.
Type> fd -d
The root directory of this disk is captured.
Do this for several disks if you wish.
Put the disk which contains FindDisk back in drive df0:.
Type> fd -s
Your new DiskList is updated and saved to disk.
Type> fd :
You should now get all your disks listed.
Type> fd <disk name>
This disk listing is displayed if it is in your DiskList.
Type> fd <name of a program>
The disk listing containing this program or directory is displayed.
Simple as that!
DiskList Format
---------------
The DiskList is stored in a compacted form which presently:
below: { unskrunched } => { skrunched }
[] is a byte of memory
* compacts strings of spaces
{ [$20] [$20] [$20] [$20] [$20] } => { [SKRUNCHAR] [30+5] }
{ [$20] [$20] } => { [$20] [$20] }
* the STARTSTR is compacted
{ STARTSTR } => { [STARTCHAR] }
BUG FIXES / UPDATE HISTORY
--------------------------
FindDisk2.2 Output now sent to stdout for redirection and piping
to work properly.
Environment variable DLDISK now defaults to
FindDisk:DiskList.
FindDisk2.1 Option -a created to capture all sub-directories on
a given disk when adding it to the DiskList.
A sub-directory can now be specified as a parameter
to the -d and -a options.
Some 2.0 error returns were not propery freeing up
allocated resouces. These were accordingly squashed.
FindDisk2.0 First release.