home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
util
/
uuinout-1.03.lha
/
uuInOut
/
uuOut.v1.03.doc
< prev
next >
Wrap
Text File
|
1993-12-16
|
12KB
|
293 lines
$VER: uuOut.doc 1.03 (15.12.93)
uuOut v1.03 by Nicolas Dade
uuOut version 1.03 is copyright 1993 by Nicolas Dade. All Rights
Reserved. Permission is hereby granted for non-commercial
duplication and distribution, and for distribution by BBSs which do
not charge for downloads, and for distribution in disk collections
which charge a nominal fee per disk. This is not shareware.
That out of the way, what is it?
It's a uudecoder to decode uuencoded text (an encoding scheme that
is used to send binary files over links that only support textual
characters---ie email and internet news)
--Why is this decoder better than those already available?--
* It's very fast at decoding (and it uses a different, even faster
decode routine if a 68020 or higher is detected).
On top of that it uses a simplification of the Boyer-Moore search
algorithm when searching for 'begin' lines, so scanning files that
are largely not uuencoded-data for data is also very quick.
(It's 100% assembly)
* It sanity checks its input so that non-uuencoded data lines are
skipped over instead of being "decoded" and producing garbage.
Sanity checking includes checking trailing checksums, M's and X's,
and the 'size' line. Some sanity checking can be disabled in case
compatibility with the original uudecode is desired.
* It allows you to specify the output directory in which to place
the decoded file(s) so that they don't have to go to the
current directory, and paths in the encoded filenames can be
ignored or obeyed (needed dirs are created automatically)
* Output files have their protection flags set to reflect the
owner's rwx unix protection bits specified in the uuencoded
data.
* It will take its input from its standard input, as well as from
a file.
* It decodes all files encoded in its input, not just the first one.
* Partially complete files (missing data lines or missing 'end' lines)
don't mess up the other, complete, files.
* It does its own io buffering using user sizeable buffers, so
your harddrive won't be slowed by thrashing if uuOut's input
and output come from and go to that harddrive.
* It's pure and it's small---you can make it resident and it
won't cost you over 4K
* uuOut reports all errors and strange conditions with descriptive
error messages, and aborts if it is sent a break signal
(Control-C).
--Requirements--:
WorkBench 2.04 or higher.
--Use--:
the template for uuOut is: INFILE,OUTPATH,BUFSIZE/K/N,VERBOSE/S
INFILE....the file from which to read the uuencoded data. If no
INFILE is specified, standard input is used.
OUTPATH...a directory from which the uudecoded files's location is
based. Usually that means that the output files go in
OUTPATH, but if the output file's name contains a path
along with a filename (i.e. "dir1/dir2/filename") then
the uudecoded file will appear in OUTPATH/dir1/dir2/filename.
(the directories "dir1" and "dir2" are created if they do
not already exist)
If OUTPATH is not specified the current-directory is used
in its place.
If this directory does not exist it too will be created.
BUFSIZE...allows you to specify the size of the input and
output buffers uuOut should use in kilobytes. The default
is 32K which is a little small for a harddrive to
harddrive decode. Try 150K or higher, until the accesses
to the harddrive become a second or so apart. If there
isn't sufficient memory available to allocate buffers of
the specified size, uuOut keeps trying small and smaller
sizes (half as large each time) until the buffer would be
smaller than 1K, at which point uuOut gives up and aborts
with an error message explaining that there isn't enough
memory in the system for the buffers. Note that if you
don't have 2K free you've got more problems on your hands
than uuOut refusing to run. :)
USEBASENAME...instead of (if need be) creating directories and placing
the uudecoded files in those directories, all uudecoded files
are created in the current-directory (or OUTPATH if specified).
i.e. "begin 644 dir1/dir2/file" would be decoded into
<current-dir>/file or OUTPATH/file, instead of
<current-dir>/dir1/dir2/file or OUTPATH/dir1/dir2/file.
IGNORETERMINATION...ignores all data from the last of the data characters
to the EOL of each line. This is to be used only when not using
it causes bad checksum error messages but you think the data is
good. It makes uuOut act like the original unix uudecode, which
means that the data can be followed by anything, including
things the usual input-checking code doesn't know about.
VERBOSE...uuOut reports each step it takes to standard-error.
--Examples--:
To decode any uuencoded files in the file "t:FreshEmail.txt" and
create the paths+files starting from the "work:" directory
uuOut t:FreshEmail.txt work:
and to use 150K io buffers instead of the default 32K when doing this
uuOut t:FreshEmail.txt work: BUFSIZE=150
and to have all the files go in the work: directory and not some
sub-directories of work:
uuOut t:FreshEmail.txt work: BUFSIZE=150 USEBASENAME
To decode the standard input stream and create the output files
in the current directory
uuOut
(kind of easy, no?)
And to decode the standard input stream and create the output
files in "t:"
uuOut OUTPATH=t:
just saying "uuOut t:" will not work because t: will be
interpreted to be the name of the input file, and uuOut will then
try to open and read from the "file" t:, find that it cannot, and
abort with an error message.
Decoding data that is stored in multiple files can be done with
the help of the C= join command: (BTW if you're just going to feed
the data to uuOut then don't bother with multiple files, they just
slow things down---instead create one giant file and feed it to uuOut)
run join file1 file2 file3 ... to pipe:file
uuOut pipe:file
or, if you have set the __pchar local variable to | and have the
pipe command installed, then it is easier to use
join file1 file2 file3 ... to out: | uuOut
(yes, the C= shell can do nameless piping, it's just not documented.)
Or if you have csh installed,
cat file1 file2 file3 ... | uuOut
And as usual, to see the template
uuOut ?
and to see the full built-in help and copyright text, give a
second "?" at the prompt following the template.
--Speed Comparisons--:
On a 7.14MHz NTSC 68000 based Amiga (ie A500, A1000 or A2000) using
the command line "uuOut ram:440KByteFile ram:", decoding the
440Kbyte file which contains a 310 KByte uuencoded file:
using: version: takes: speed:
uuOut 1.03 5.7 secs 77Kb/s
UUDecodeX 1.02 27.7 secs 16KB/s
UUxT 2.2 41.3 secs 11Kb/s
uudecode ?** 64.3 secs 7Kb/s
** by Mark Horton and Alan J. Rosenthal. I couldn't find any version
information.
I don't have a 68020 Amiga handy, but on a 22MHz 68030 based
A2000 the same commands took:
using: version: takes: speed:
uuOut 1.03 1.0 secs 440Kb/s
UUDecodeX 1.02 4.7 secs 94KB/s
UUxT 2.2 7.2 secs 61Kb/s
uudecode ? 10.0 secs 44Kb/s
--Sanity Checking of Input--:
uuOut's input-checking keeps it from trying to decode lines that
obviously aren't data lines, and it's difficult to fool, unlike a
certain other uudecoder that advertises this feature. uuOut insists
a data line contain only the characters 0x20 (space) through 0x40
(backquote) inclusive (0x40 is considered equivalent to 0x20), and
have the right number of characters (the first byte of a data line
is a count). Furthermore the data line must end with (optionally)
a checksum character, (optionally) an X or M, and then either a
LF or a CR, and the checksum, if it is present, must be correct.
(If a line looks good except that it's checksum is bad, uuOut
ignores the data in the line, but warns you that a line that
looked like data but had a bad checksum is being skipped.)
This means that mail and news header lines aren't considered data
because the header names contain lowercase characters or, if they
don't, rarely (that's the .1% of the time) contain the right
number of characters. You _can_ 99.9% of the time pass mail or news