[comp.sys.atari.8bit] SHRINK program to encode a whole disk into a file

jhs@mitre-bedford.ARPA (11/18/87)

By popular request (well, would you believe one request that was convincing?),
here is SHRINK, in uuencoded form.

SHRINK, in case you aren't aware of it, is one of several utilities for
encoding a whole disk into a file.  It does some data compression along the
way, so the file usually will fit on a single disk of the same density as
the original, despite the fact that the new disk also has to allocate space
for its disk directory, etc.  SHRINK puts up a menu which lets you choose
encoding (shrink) or decoding (unshrink) mode.

SHRINK or one of its relatives (DISKCOM or SCRUNCH) should be used when you
want to send a boot disk or a version of DOS, etc., over the net.  The normal
procedure would be to SHRINK a disk into a file, then UUENCODE the file
(perhaps using Dunning's YAUE), and then send the file.  At the other end,
the recipient of course must first UUDECODE the file, then UNSHRINK it to
a new disk, which now becomes an exact replica of the original disk.

SHRINK is needed to UNSHRINK the version of FrOst BASIC that I have sent to
several people, as that program is provided as a boot disk.

Anyway, here's SHRINK.  The title screen gives credits, sorry I don't
recall the name of the author.

-John Sangster, jhs@mitre-bedford.arpa
----------------------------c-u-t---h-e-r-e-----------------------------------
begin 600 shrink.com
M__^T +8 1&XZ___& ,P 1#$Z*BXJF___KP7]!B [M) #3$NTYH?0 N:(I8>-
M"@.EB(T+ Z63C00#I92-!0.I0(T# ZE2C0(#J3&-  .EG8T! ZD C0<#C0D#
MJ06-!@.I@(T( R!9Y*T# Q #3,6W8'V;L;J@T\C2R<[+H)M7:&EC:"!D<FEV
M92!H87,@=&AE(&1I<VL@=&\@8F6;4TA254Y+/R  ?4EN<V5R="!D:7-K*',I
MFP"I Z &(*VT(/NU(&RZA9T@A[FI.* &(*VT(-FU&*6=:3#%M? $A:+0#J6C
M\ H@1;NEK(6E( V[J0"%C(6<A8>%B(6)(*\%K><"A8"MZ *%@:  N1*\\ 61
M@,C0]ABE@&D,A96E@6D A99,OP:MZ *%EJWG H65&*65:0.%E:66:0"%EJ65
MA9BEEH69J0"%C86.I96%FJ66A9NI (6/A9"%D:2)L9.%E^:)$ <@KP6I (6)
M3)FR__^9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