home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
500.lha
/
nodelete_v1.5a
/
nodelete.doc
< prev
next >
Wrap
Text File
|
1991-04-08
|
11KB
|
253 lines
*************************************************************************
* NoDelete V1.5A (C) HooverSoft Oct 30th, 1990 *
*************************************************************************
USAGE: 1> run NoDelete [patterns] [-p priority] [-y ypos] <ENTER>
from CLI only.
HISTORY
CHANGES TO VERSION 1.4: MAR 1991
Switched to ARP (finally). This great bunch of routines should have
experienced a wide enough distribution by now to make this acceptable.
Cheers to everyone involved in this project! ARP is used to do the pattern
matching on filenames. No more restriction is made on the patterns. They
can be complete filenames or just patterns, with every ARP wildcard
allowed. I forgot the name of the guy who suggested this one, and answers
by UUCP is not a favourite of math4.unibi.de. Anyway, as soon as this is
implemented, you'll get a "thank you", mate!
CHANGES TO VERSION 1.35: OCT 1990
Programmed two new options -O and -S (Cheers, John!). These options sort
of "fix" a bug with NoDelete which used to override the file protection
bit.
CHANGES TO VERSION 1.3: SEP 1990
Lots of changes. Thinking of writing a new documentation. Anyway,
introduced command line options -p and -y for run-time setting of priority
of NoDelete and of vertical position of titlebar.
CHANGES TO VERSION 1.2: AUG 1990
Introduced the possibilty to give multiple patterns on startup. Lists
patterns when pressing a key while Nodelete's titlebar is active.
CHANGES TO VERSION 1.1: Aug 1990
NoDelete now automatically centers the Dragbar on Screen and calculates the
correct width for the window if a pattern is specified.
Now works fine with AmiOmega. System won't crash if "Yes, Delete!" is
selected.
Now supports the use of patterns to ask confirmations only for special
files ending in defined pattern. Will show the selected pattern in
window's titlebar.
NoDelete now checks if another NoDelete is already active and exits if
true.
CHANGES TO VERSION 1.01: Jul 1990
Now handles protected Files correctly. Previous version didn't complain if
file was delete protected.
NoDelete sets its priority to a value of -5 directly after startup.
CHANGES TO VERSION 1.00: June 1990
Version 1.01 now restores the Dos Vector relative to _DosBase, so this
program should work under Kickstart 1.3 as well. If someone already uses
Kick 2.0, he or she should let me know if NoDelete works with that. I have
heard that the funny instructions in DosBase have been replaced with a
regular jump table.
WHY USE NODELETE?
I wrote this program mainly to make the fantastic public domain game
"Omega" more enjoyable to play. The author of this program thought it
reasonable to have the system unlink the save-file after having reloaded it
to somehow "simulate the continuity of character". Too bad that NoDelete
does not work correctly with this program...
Footnote: It works now!
WHAT IT DOES
NoDelete enables you erraneous humans to once again reflect on the
righteousness of your decisions concerning the deleting of files on
AmigaDos devices. If you try to delete a file or a program tries to remove
it, this is mostly done via DeleteFile() of the dos.library. When
executed, NoDelete bends this vector to its own routine which brings up
this cute little requester on the active window. This requester contains
the name of the file that the system is trying to delete. If you really
want to delete this file, click to the "Yes, Delete!" gadget. If not,
click to the "Oops, no way!"-Gadget of the requester. NoDelete works just
fine with aliases, wildcards etc. For problems see the "known
bugs"-section of this text.
PATTERNS
Lots of programs, programmers and normal people use patterns in their file
system to be able to immediately make out the contents of a file. For
example, ".c" specifies the file to be a C source code and ".bas" should
contain a basic program's source. There are tons of frequently used
extensions, from ".asm" up to ".cfg". If you use NoDelete and you don't
want the system to get on your nerves by confirming EVERY rm command, you
should use a certain extension on NoDelete's command line to tell NoDelete
that it should only ask confirmation for those precious ".c" or ".iff"
files and let all others alone.
The new version of NoDelete also supports complete filenames as pattern
matching is done via PatternMatch() of ARP. The command line
1> run nodelete *.c
would tell NoDelete to only intercept the removing of files ending in ".c"
and not to worry about any other files that are removed from the device.
You can specifiy up to ten patterns when running NoDelete. The command
1> run NoDelete *.c *.iff *.tex *.asm
will make NoDelete complain about any file which ends in one of the
specified patterns and leave all others alone. If you have forgotten which
patterns you specified at startup, just activate NoDelete's titlebar and
press any key. NoDelete will then give a list of patterns in the titlebar
until another key is pressed.
Another one:
1> run NoDelete Peter Pecker picked a pepper
would intercept any attempt to remove the files peter, pecker, picked, a,
and pepper. NoDelete does discriminate between upper or lower case letters
in filenames. If the extensions get too long to fit into the titlebar...
well, you won't see them!
To make things totally clear, let me cite the ARP programmer's manual:
CITE
arp.doc/PatternMatch (V31)
NAME
PatternMatch - perform a wildcard match on a string
SYNOPSIS
result = PatternMatch(pat,str)
D0 A0 A1
FUNCTION
This function compares a string to the given pattern and determines
if it is a valid match. If so it returns a true result.
The pattern must be constructed with special preparsed tokens and
supports the following patterns:
(p1|p2|p3) One of the patterns p1, p2 or p3
? Any single character
#<pat> Pattern repeated 0 or more times
[class] Character class
[^class] Negated character class
{pat} Structure tag for replacement
* 0 or more occurances of any character
INPUTS
char *pat The pattern string to match against
char *str The string to be matched
RESULT
result - a boolean value indicating success/failure. The condition
codes are guarenteed to reflect the status of the result
BUGS
None known.
SEE ALSO
Author: JAT
END CITE
Right? So far for all the wildcards you can use with ARP. IMPORTANT NOTE:
if you work with Csh or WB 1.3 shell, you will have to escape the
characters special to these shells, respectively. To protect all C sources
while in Csh, you would use the syntax
$ run nodelete \*.c
to have the special shell wildcard "*" survive on its way to NoDelete.
COMMAND LINE OPTIONS
Finally, HooverSoft is proud to have introduced command line options in
NoDelete. So far, four options are supported:
-p number where number is an integer between -20 and 9. If given on
the command line, NoDelete will set its priority to this
value. If you type rubbish or use values not allowed, the
default priority of -5 is set.
-y ypos where ypos is an integer ranging from zero to 245 (sorry,
all you NTSC users...). This number will determine the ver-
tical position of NoDelete's titlebar. if you try to fool
NoDelete or do not give this option, the default value zero
(top of screen) is used.
-O Override file protection bit. If this option is given,
NoDelete will NOT care about the file's protection status.
This option is sort of dangerous, but I think if you are
explicitly asked wether you want to delete a file this
should be presto! wiped off the disk without return or
any other chance of survival..., Anyway, the default now
is to consider and respect the file protection.
-S if given, this option tells NoDelete to shut up. No screams,
no comments!
KNOWN BUGS
NoDelete cannot take care of the AmigaDos command Delete. God knows how
this command erases a disk file...
The Shell won't complain if you try to delete any non-existent file while
NoDelete has its grip on the system. This is not really a bug because
NoDelete works on this basis of cheating the calling function and
pretending that everything is just fine and deleted. This also is the cause
that the calling program will not be informed if the file in question
is delete protected.
THE LEGAL STUFF
NoDelete is FreeWare and may be copied freely by everyone except for
purposes listed below as long as this notice is left intact. This program
is copyright (C) by HooverSoft. It may NOT be copied or sold for
commercial purposes without written permssion by the author (Get lost,
Carsten Wolf and all you other sharks!). It may be distributed and copied
freely for non-commercial purposes only.
When distributed, this program should always be accompanied by this file,
the documentation.
FURTHER PLANS & HOPELESS DREAMS
I would like to use CreateTask() to launch a separate Task for Nodelete.
This would unlink NoDelete's memory requirements from the current stacksize
of the system. It would be nice if "delete" could also be disabled but I
am not sure how to do this.
CREDITS
I'm very thankful to all those people who have continued to make their
sources available through FreeWare, especially Fred Fish, Udo K Schuermann
(The walrus and maintainer of Akvarium Data Files) and Matt Dillon.
PUBLIC FEEDBACK
Bug reports (cheers, Jensi & John!), criticism, comments and approvements
should be sent to
SNAIL:
HooverSoft Inc.
Joellenbecker Weg 4
D-4900 Herford
Germany
BITNET:
hoover@math4.uni-bielefeld.de
DISCLAIMER
Do whatever you like with this program, but listen: you can't blaim it on
me if anything goes down the drain!
Have fun,
Hoover
--
"It's impossible to make things foolproof because fools are so ingenious..."