home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
arconv01.exe
/
A2.DAT
< prev
next >
Wrap
Text File
|
1993-06-28
|
4KB
|
165 lines
set DEFAULT=arj
set ARCINDEX=1
unset /q ALLFILES
if "%1" == "" goto syntax
if "%1" == "arj" goto arj
if "%1" == "zip" goto zip
if "%1" == "lzh" goto lha
if "%1" == "zoo" goto zoo
if "%1" == "arc" goto arc
if "%1" == "hpk" goto hpack
if "%1" == "sqz" goto squeeze
if "%1" == "ash" goto ash
if "%1" == "ha" goto ha
if "%1" == "hap" goto hap
if "%1" == "z" goto gzip
if "%1" == "hyp" goto hyper
goto %DEFAULT
:arj
iff "%1" == "arj" then shift ^ endiff
%BASEDIR\arj a -jm %&
goto finish
:zip
iff "%1" == "zip" then shift ^ endiff
iff "%1" == "-r" then
%BASEDIR\pkzip -rp -ex %&
else
%BASEDIR\pkzip -ex %&
endiff
goto finish
:lha
iff "%1" == "lzh" then shift ^ endiff
%BASEDIR\lha a %&
goto finish
:hpack
iff "%1" == "hpk" then shift ^ endiff
%BASEDIR\hpack a -d %&
goto finish
:squeeze
iff "%1" == "sqz" then shift ^ endiff
iff "%1" == "-r" then shift ^ set SUB=-s
endiff
gosub getfiles
%BASEDIR\sqz a -z03 %SUB %& %ALLFILES
goto finish
:zoo
iff "%1" == "zoo" then shift ^ endiff
iff "%1" == "-r" then shift ^ endiff
:: Unfortonately, I do not know how to handle recursion with zoo
gosub getfiles
%BASEDIR\zoo ah %& %ALLFILES
goto finish
:arc
iff "%1" == "arc" then shift ^ endiff
iff "%1" == "-r" then shift ^ endiff
:: Unfortonately, I do not know how to handle recursion with arc too.
gosub getfiles
%BASEDIR\pkpak a %& %ALLFILES
goto finish
:ash
iff "%1" == "ash" then shift ^ endiff
iff "%1" == "-r" then shift ^ endiff
%BASEDIR\ash 3 %1 %@NAME[%1].ash
goto finish
:ha
iff "%1" == "ha" then shift ^ endiff
iff "%1" == "-r" then
shift
%BASEDIR\ha ar %&
else
%BASEDIR\ha a %&
endiff
goto finish
:hap
iff "%1" == "hap" then shift ^ endiff
iff "%1" == "-r" then shift ^ endiff
gosub getfiles
%BASEDIR\hap3 a %& %ALLFILES
goto finish
:gzip
iff "%1" == "z" then shift ^ endiff
iff "%r" == "-r" then shift ^ endiff
%BASEDIR\gzip %&
goto finish
:hyper
iff "%1" == "hyp" then shift ^ endiff
iff "%1" == "-r" then
%BASEDIR\hyper -a -p %&
else
%BASEDIR\hyper -a %&
endiff
goto finish
::------Procedures:
:: This procedure tries to guess and find the filename argument, i.e,
:: It puts ARCINDEX to point to the first arg not starting in "-" or "/".
:findindex
if "%@SUBSTR[%[%ARCINDEX], 0, 1]" != "-" .and. "%@SUBSTR[%[%ARCINDEX], 0, 1]" != "/" goto findend
set ARCINDEX=%@EVAL[%ARCINDEX + 1]
goto findindex
:findend
return
::This procedures uses findindex to try to find out whether filenames to
:: archive were given. If not, the variable ALLFILES is set to *.*, otherwise
:: it is null. Thus, if you call your archiver with this var as last arg, after
:: calling this procedure, it'll default to all files when no filenames archive
:: are supplied by the user. This is comfortobale, and required by TO.BTM
:getfiles
gosub findindex
iff "%[%@EVAL[%ARCINDEX + 1]]" == "" then set ALLFILES=*.*
endiff
return
:syntax
echos Syntax: %0 [
color bright green on black
echos arc
color white on black
echos ] [
color bright blue on black
echos -r
color white on black
echos ]
color bright yellow on black
echo arguments...
color white on black
echos Where
color bright green on black
echos arc
color white on black
echo is one of the following: arj zip lzh zoo arc hpk sqz ha hap ash z hyp
echo Default for arc is %DEFAULT.
color bright blue on black
echos -r
color white on black
echo Stands for recurse into sub-dirs (Irrelevant for .Z, .ARC, .ASH)
color bright yellow on black
echos arguments
color white on black
echo are the arguments for the archiver (including the archive's name),
echo except for the adding cmd, which is added automatically by this file.
:finish
endlocal
quit