home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
compress
/
a2l.lha
/
A2L.txt
next >
Wrap
Text File
|
1990-02-13
|
4KB
|
93 lines
I recently downloaded the Arc2Lharc script file which was supposed to
make the process of converting .arc files into .lzh files much easier. I
didn't even execute the script to try it out...after reading the script and
the doc that came with it I was completely mystified as to why such a simple
thing was done in such a long, complicated, two-step process. Here's a MUCH
simpler script file (6 lines vs. 49 lines for Arc2Lharc) that accomplishes
the same thing, and unlike Arc2Lharc does not require you to CD to the
directory the target file is in, or execute a second script just to rename
the converted file(s). I call it A2L, you can call it anything you want:
.k path,name
cd ram:
pkax >nil: <path><name>
lharc >nil: a <name> *
copy <name>.lzh <path>
delete >nil: #? <path><name>.arc
And here's the Very Important Obligatory Note about the above script:
You might say the above is for advanced users who know what they're doing,
while Arc2Lharc was for beginners that need hand-holding and error-checking.
I make a few assumptions in the above script. First I assume if you're an
advanced user you're using PKAX (much faster than ARC), and have it and LHARC
in your C: directory. Second, I assume if you're an advanced user you're
smart enough to remember the correct usage for this script: you MUST give
the full path of the file you want to convert (including a final "/" after a
directory name), even if it's in your current directory; you MUST leave a
space between the path and the filename; and you must NOT include the ".arc"
suffix in the filename. Example: the file you want to convert is named
Test.arc and is on DF1:. If you're using the Shell (not CLI), have A2L in
your S: directory with its script bit set, and S: is in your path, you would
simply say:
a2l df1: test
If Test.arc were inside a directory called Stuff on DF1:, you would say:
a2l df1:stuff/ test
That's it...and you don't have to execute an additional script just to
rename the file(s) you've converted. You'll end up with an Lharc'd file
called Test.lzh wherever Test.arc was, and Test.arc will be deleted.
And here's the Standard Obligatory Disclaimer: This script worked
perfectly for me, but there are as many different "working environments" as
there are Amigas. I can think of several "gotchas" you should be aware of if
you use this script. (They are all taken care of in the second example
script listed below.)
1. A2L doesn't CD back to the original directory it was started from.
2. You might be CD'd to RAM: with the file you want to convert also
in RAM:.
3. You might have other files in RAM: that you wouldn't want deleted or
included in the .lzh file.
4. You might be trying to convert a file on a disk that's close to, or
maybe is, 100% full.
Number 1 doesn't bother me, but it might bother you; numbers 2, 3 & 4
wouldn't happen in my environment, but they might in yours. So to handle
these possibilities, here's a script that works for Every Situation In The
Known Universe That I Can Think Of At The Moment:
.k path,name
assign here: ""
makedir ram:temp
cd ram:temp
pkax >nil: <path><name>
lharc >nil: a <name> *
delete <path><name>.arc
copy <name>.lzh <path>
cd here:
assign here:
delete >nil: ram:temp all
As for myself, I just wrote this because Arc2Lharc seemed like using a
sledgehammer to kill a mosquito. Personally I wouldn't use Arc2Lharc OR A2L!
Why? Because too many arc files contain a bunch of files named "Xfile1",
"Xfile2", etc., with an execute.me file included to rename and/or create
directories. If you just Lharc these "Xfiles" along with the execute.me
file, you've lost half the advantage of using Lharc. You'll have a smaller
archive, but still the pain of those infernal execute.me files which I've
found are sometimes broken and don't work anyway. If the execute.me files
were ALWAYS named "execute.me", it would be easy to have A2L check for the
existence of a file named "execute.me" and if it existed, execute it, then
delete it, then Lharc everything else, including directories, subdirectories,
and long filenames. BUT...sometimes they're named "execute.me", and
sometimes they're named "x.me", or "x.it", or "DoIt", or.... Besides, I have
a feeling Zip is going to eventually win The Amiga Compression Wars.
-Joel Salazar
Feb. 13, 1990
PLINK: WALRUS
GENIE: WALRUS
CIS: 73557,2347