BBS: Inland Empire Archive Date: 12-31-92 (18:57) Number: 364 From: SCOTT WUNSCH Refer#: NONE To: JOEL MASLAK Recvd: NO Subj: Telling Archives Aparty Conf: (2) Quik_Bas
Salutations, Joel!
You're in luck, Joel. I just saw this pass through the BASIC7 conference:
From: Harvey Parisien, 1:249/114 (24 Dec 92 15:57)
To: All
Subj: Auto unarchive detection routine
__________O_/________________/ SNIP \__________________\_O__________
O \ \ HERE / / O
DEFINT A-Z
FUNCTION autounarc$ (arcname$)
autounarc$ = ""
IF NOT Exist(arcname$) THEN EXIT FUNCTION
'get archive id markers
ff = FREEFILE
OPEN arcname$ FOR BINARY AS ff
tem1$ = SPACE$(5)
tem2$ = SPACE$(1)
GET #ff, 1, tem1$
GET #ff, LOF(ff) - 1, tem2$
CLOSE ff
'test for archive type and set unarchive command
IF LEFT$(tem1$, 4) = "PK" + CHR$(3) + CHR$(4) THEN
autounarc$ = "PKUNZIP -o " + arcname$
ELSEIF RIGHT$(tem1$, 3) = "-lh" THEN
autounarc$ = "LHA e " + arcname$
ELSEIF LEFT$(tem1$, 2) = "`" + CHR$(234) THEN
autounarc$ = "ARJ e " + arcname$
ELSEIF LEFT$(tem1$, 3) = "ZOO" THEN
autounarc$ = "ZOO e " + arcname$
ELSEIF tem2$ = CHR$(254) THEN
autounarc$ = "PAK e /wa " + arcname$
ELSEIF LEFT$(tem1$, 1) = CHR$(26) THEN
autounarc$ = "PKUNPAK /r " + arcname$
ELSE
PRINT "UNKNOWN ARCHIVE TYPE: " + arcname$
END IF
END FUNCTION
-+- PPoint 1.39 * Seasons Greetings...
+ Origin: Harvey Parisien (1:249/114)
__________O_/________________/ SNIP \__________________\_O__________
O \ \ HERE / / O
Will that help? ;)
/\ LLAP...
> \ cott \\'unsch <
\/
... Tag! You're it!
---
* Origin: Point of no return -=- Regina, Sask, Canada -=- (1:140/23.1701)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET