BBS: Inland Empire Archive
Date: 01-01-93 (16:35) Number: 400
From: ROBERT CHURCH Refer#: NONE
To: JOEL MASLAK Recvd: NO
Subj: Telling Archives Aparty Conf: (2) Quik_Bas
Joel Maslak entered the following ASCII codes for the
viewing pleasure of All:
JM> I am writing a program that unarchives *ALL* archives,
JM> regardless of the type. To do this, I am going to make calls
JM> to the various dearchiving programs, but first I need to be
JM> able to tell what archive is what archive... Example: How
JM> do you know it is a Zip or Arc (regardless of ext, as I am
JM> writing this as an accessory for my mailtosser)?
Here you go:
DECLARE FUNCTION GetArchive$ (FileName$)
FUNCTION GetArchive$ (FileName$)
COMPRESS.CFG included in
message base utility. Thanks Scott!
Free = FREEFILE
OPEN FileName$ FOR BINARY AS #Free
DIM Ident AS STRING * 5
bytes of the file GET #Free, , Ident
first five bytes
IF LEFT$(Ident, 1) = CHR$(26) THEN
if the first
GetArchive$ = "arce "
extract the ARC ELSEIF LEFT$(Ident, 4) = "PK" + CHR$(3)
+ CHR$(4) THEN
GetArchive$ = "PKUNZIP "
ELSEIF RIGHT$(Ident, 3) = "-lh" THEN
2 GetArchive$ = "LHA E "
it's an LHA. ELSEIF LEFT$(Ident, 2) = CHR$(96) +
the file GetArchive$ = "ARJ E "
CHR$(234), it`s an ARJ. ELSE
GetArchive$ = ""
SUB Unarchive (FileName AS STRING)
UnpackProg$ = GetArchive$(FileName)
SHELL UnpackProg$ + FileName
[-= Rob =-]
* Origin: -= The Floating Point =- Hillsboro, Oregon, USA,