home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
util
/
uuinout-1.03.lha
/
uuInOut
/
uuIn.v1.03.doc
< prev
next >
Wrap
Text File
|
1993-12-15
|
9KB
|
232 lines
$VER: uuIn.doc 1.03 (15.12.93)
uuIn v1.03 by Nicolas Dade
uuIn 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 uuencoder to encode binary files into 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 encoder better than those already available?--
* It's very fast. (and it uses a different, even faster encode
routine if a 68020 or higher is detected) (It's 100% assembly)
(and that 020 routine works now---sorry about that 1.01 problem)
* It will automatically generate multiple output files using maximum
lines and/or maximum bytes limits, and prevent widow files that
contain no full data lines. (nn's :decode doesn't like them)
* the name and protection modes encoded in the begin line can be
specified, or intelligent defaults are used.
* Data lines are terminated with a checksum, and a size line is
added at the end of the data. (both can be disabled)
* It will take its input from its standard input and write its
output to standard output, as well as to and from files.
* It does its own io buffering using a user sizeable buffer, so
your harddrive won't be slowed by thrashing if uuIn's input and
output come from and go to that harddrive. (and it uses only one
buffer)
* It's pure and it's small---you can make it resident and it
won't cost you over 5K
* uuIn reports all errors and strange conditions with descriptive
error messages, and aborts if it is sent a break signal
(Control-C).
--Requirements--:
2.04 or higher.
--Use--:
the template for uuIn is: INFILE,OUTFILE,NAME/K,MODE=PROTECTION/K,
MAXLINES/N,MAXBYTES/N,NOCS=NOCHECKSUM/S,NOSIZE/S,NORENAME/S,
BUFSIZE/K/N,VERBOSE/S.
INFILE....the file from which to read the data to be encoded. If no
INFILE is specified, standard-in is used.
OUTFILE...the file to which the encoded data should be written. If
MAXLINES or MAXBYTES is used then OUTFILES is used as a
basename for the multiple files, numbered 1 through n with
as many leading zeros as needed (using an intelligent
amortized-cost-1 algorithm---use VERBOSE and you'll see :)
NAME......you can specify the name to store in the encoded data
(on the begin line). The default is the FilePart() of
INFILE. If you are not using INFILE (if you are using
standard-in) then NAME must be specified.
MODE=PROTECTION lets you specify the un*x protection mode to store
in the encoded data. This can be given two ways: three
octal digits (i.e. 644) or a seqence of rwx- (i.e.
rw-r--r--) which I personally find more readable. The
default is to copy the protection bits of INFILE or assume
644 if standard-in is used. The amiga protection bits are
translated to un*x as follows:
amiga read -> un*x read for everyone
amiga write and amiga delete -> un*x write for owner
amiga execute -> un*x execute for everyone
MAXLINES..If you want to generate multiple output files each of
which has no more than a certain number of lines, MAXLINES
will let you specify that limit. See OUTFILE and examples
for description of filenames generated. If no OUTFILE is
used (standard-out is used) then no limits may be
specified.
MAXBYTES..Similar to MAXLINES but puts a byte limit in the files. Both
MAXBYTES and MAXLINES can be specified, in which case each
file will be withing both limits.
NOCS=NOCHECKSUM...Keeps uuIn from adding a checksum to each data
line. The checksums are similar to the 'X's ADDX adds
except that they allows the decoder to double-check that
the data in the line is ok.
NOSIZE....Keeps uuIn from adding a size line at the end of the
data, right after the end line. This line is used by
decoders to double check that the file they decoded was
all there (has the correct size).
NORENAME..Keeps uuIn from renaming output files when uuIn is producing
mutiple output files and the digits uuIn is appending
to the filenames overflow the number of characters uuIn
has allocated for them. For example, when uuIn goes
from "out.uu.9" to "out.uu.10" it will try to rename "out.uu.1"
through "out.uu.9" to "out.uu.01"..."out.uu.09". This can
cause problems if the device it is outputting on does not
support renames. (i.e pipe:)
BUFSIZE...allows you to specify the size of the io buffer uuIn should
use in kilobytes. The default is 32K which is a little
small for a harddrive to harddrive encode. If you specify a
buffer larger than your largest block of free ram uuIn
will keep decreasing the size by half, trying to get some
buffer, until the buffer would be under 1K, at which point
uuIn gives up. If you don't even have 1K free you're in
more trouble than just having uuIn refuse to run. :)
Specifying 0 means some thing special: uuIn will use a buffer
as large as the file (again, subject to the availability
of memory). Naturally this does not work with pipes (uuIn falls
back on the default 32K).
In any case the buffer is always 1K, and never more than
MAXBYTES or 63*MAXLINES, whichever is smaller.
VERBOSE...progress reports are written to standard error.
--Examples--:
To encode the file "binaryfile" and put the results in the file
"uuedata"
uuIn binaryfile uuedata
and to use 150K io buffers instead of the default 32L when doing
this
uuIn binaryfile uuedata BUFSIZE=150
To split the output into as many files as are needed to keep each
file under 9Kbyes and under 900 lines (which ever comes first)
uuIn binaryfile uuedata MAXLINES=900 MAXBYTES=9000
and files called "uuedata1", "uuedata2", etc will be created. If
this takes more than 9 files then first file will be called
"uuedata01". If this takes more than 99 files then first file will
be called "uuedata001", etc.
To encode the standard input stream and output the result to the
standard output stream, while naming the encoded data "mydata"
uuIn NAME=mydata
and to encode its protection as rw-r-----
uuIn NAME=mydata MODE=rw-r-----
And as usual, to see the template
uuIn ?
and to see the full builtin 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 "uuIn ram:310KByteFile ram:440KByteOutput", encoding
the 310Kbyte file which produces a 440 KByte uuencoded file:
using: version: takes: speed:
uuIn 1.03 5.4 secs 57Kb/s
UUEncodeX 1.02 13.1 secs 24KB/s (using NOCHECK option)
UUxT 2.2 50.0 secs 6Kb/s
and on a 22 MHz 68030 the same command took
uuIn 1.03 1.0 secs 310Kb/s
--Widow Files--:
If the last outfile would contain no full data lines---just any of
the final partial line, the empty line, the end line and the size
line---then that file is not created. Instead the output is placed at
the end of the previous file. This is done because nn (an internet
news reader) and other "join and uudecode multiple parts" programs do
not handle widow files correctly (BTW my uudecoder, uuOut, does). This
may push the previous file over the MAXLINES and/or MAXBYTES limits.
If this happens uuIn will warn you. The widow lines are never more
than 5 lines and 87 bytes.
--I can be reached at--:
Nicolas Dade
405 W Delaware
Urbana, IL 61801 (USA)
nicolas-dade@uiuc.edu
--History--:
1.00 o First version debugged enough to pass around.
1.01 o Improved the inteligence of the buffer allocation
routine, and made it use only one buffer.
o Messages directed at the user are sent through std-error
(Process_CES).
1.02 o Grrrrr. 1.01's 020 code had a ".b" that should have been a
".w".
o Since Alan T Shutko so nicely sent me the code for the
checksums, I added it in.
o Thanks to Marcus Damberger for testing this version of