home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK5
/
DOS_01
/
4DVC31.ZIP
/
4DVCPACK.BTM
< prev
next >
Wrap
Text File
|
1991-01-04
|
6KB
|
161 lines
@echo off
cls
@md 4DVCPACK >&! NUL
@cd 4DVCPACK
echo %@upper[%@name[%1].%@ext[%1]]: >>&! ..\4DVCPACK.0
@del /qy *.* >&! NUL
echo Extracting all versions of all files from %@name[%1].%@ext[%1]...
PKUNZIP -en ..\%@name[%1].%@ext[%1] >&! NUL
set VCZIP=%?
if %VCZIP EQ 0 PKZIP -q-vcbne ..\%@name[%1].%@ext[%1] >&! 4DVCPACK.0
iff %? EQ 0 then
iff %VCZIP EQ 0 then
goto DOIT
endiff
endiff
set VCZIP=
cd ..
@del /qy 4DVCPACK\*.* >&! NUL
@rd 4DVCPACK
echo Could not unZIP all archive files and comments. Make sure there is >>&! ..\4DVCPACK.0
echo enough room on your disk, and that it is not write/password protected. >>&! ..\4DVCPACK.0
echo -------------------------------------------------------------------------------- >>&! ..\4DVCPACK.0
quit
:DOIT
set VCZIP=
set VCRCD=8
:DESCTOP
if %@len[%@line[4DVCPACK.0,%VCRCD]] EQ 0 goto DESCEND
if "%@substr[%@line[4DVCPACK.0,%VCRCD],1,6]" EQ "------" goto DESCIN
:DESCOUT
set VCRCD=%@eval[%VCRCD + 1]
goto DESCTOP
:DESCIN
set VCRCD=%@eval[%VCRCD + 1]
if "%@substr[%@line[4DVCPACK.0,%VCRCD],1,6]" EQ "------" goto DESCOUT
set VCNAM=%@substr[%@line[4DVCPACK.0,%VCRCD],46,12]
set VCRCD=%@eval[%VCRCD + 1]
set VCCOM=%@substr["%@line[4DVCPACK.0,%VCRCD] ",10,41]
describe %VCNAM "%VCCOM"
set VCCOM=
set VCNAM=
goto DESCIN
:DESCEND
set VCRCD=
@del /q 4DVCPACK.0 >&! NUL
set VCEXT=
set VCNAM=
echo *********************************************************************
echo Resequencing files...
for %%Z in (*.*) do gosub REDUCE
rem handle version 1000 if any exist
iff exist *.000 then
for %%Y in (*.000) do gosub BUMP1000
set VCEXT=
set VCNAM=
for %%Z in (*.*) do gosub REDUCE
if exist *.000 del /q *.000 >&! NUL
if exist *.@@@ ren /q *.@@@ *.000 >&! NUL
endiff
set VCEXT=
set VCNAM=
set VCWRK=
echo *********************************************************************
iff "%VCZIP" EQ "" then
echo No Resequencing was performed. Archives already PACKed. >>&! ..\4DVCPACK.0
goto WRAPUP
endiff
echo Rearchiving newly resequenced files...
for %%Z in (*.*) do gosub SAVEIT
iff %? NE 0 then
echo Could not reZIP all archive files and comments. Make sure there is >>&! ..\4DVCPACK.0
echo enough room on your disk. >>&! ..\4DVCPACK.0
else
copy %@name[%1].%@ext[%1] ..\*.* >&! NUL
endiff
:WRAPUP
echo -------------------------------------------------------------------------------- >>&! ..\4DVCPACK.0
cd ..
set VCZIP=
@del /qy 4DVCPACK\*.* >&! NUL
@rd 4DVCPACK
quit
rem *******************************************************************
rem *
rem * This routine renames version 1000 to:
rem * 999 if there is not currently a 999 version
rem * @@@ if there is a 999 version (in which case, version 1000
rem * will remain 000 and get renamed back to 000 later on)
rem *
rem *******************************************************************
:BUMP1000
iff exist %@name[%Y].999 then
ren /q %Y *.@@@ >&! NUL
return
endiff
copy %Y *.999 >&! NUL
return
rem *******************************************************************
rem *
rem * This routine processes each file in the subdirectory. When a
rem * name-break occurs, the "expected" version number is reset to
rem * 001, and incrimented by 1 for each file of the same name. If
rem * the actual extension of the file does not match the expected
rem * extension (version), the file is renamed.
rem *
rem *******************************************************************
:REDUCE
set VCWRK=%@upper[%Z]
rem **** we won't touch version 1000 in this loop
if "%@ext[%VCWRK]" EQ "000" return
if "%@ext[%VCWRK]" EQ "@@@" return
rem **** test for filename break
iff "%@name[%VCWRK]" NE "%VCNAM" then
set VCNAM=%@name[%VCWRK]
set VCEXT=001
else
set VCEXT=%@eval[%VCEXT + 1]
if %@len[%VCEXT] EQ 1 set VCEXT=00%VCEXT
if %@len[%VCEXT] EQ 2 set VCEXT=0%VCEXT
if %@len[%VCEXT] EQ 4 set VCEXT=000
endiff
rem **** rename the file if not at the expected version number
iff "%@ext[%VCWRK]" NE "%VCEXT" then
echo %VCWRK renamed to %@name[%VCWRK].%VCEXT
echo %VCWRK renamed to %@name[%VCWRK].%VCEXT >>&! ..\4DVCPACK.0
ren /q %VCWRK %@name[%VCWRK].%VCEXT
set VCZIP=X
endiff
return
rem *******************************************************************
rem *
rem * This routine locates the comment for each file in turn and
rem * calls PKZIP to add the file to the archive with the comment.
rem * If everything went ok, the file is deleted (mking room for more
rem * files in the archive if disk space is short.
rem *
rem *******************************************************************
:SAVEIT
if %? NE 0 return
if "%@upper[%@ext[%Z]]" EQ "ZIP" return
set VCRCD=0
:FINDDESC
iff "%@line[DESCRIPT.ION,%VCRCD]" EQ "" then
keystack "No Comments Provided " 13
goto HAVEDESC
endiff
iff %@index["%@upper[%@line[DESCRIPT.ION,%VCRCD]]",%@upper[%@name[%Z].%@ext[%Z]]] EQ 1 then
keystack "%@substr["%@line[DESCRIPT.ION,%VCRCD] ",%@eval[%@len[%@name[%Z].%@ext[%Z]]+2],40]" 13
else
set VCRCD=%@eval[%VCRCD + 1]
goto FINDDESC
endiff
:HAVEDESC
set VCRCD=
set VCZIP=%@substr[%@name[%1],4,%@eval[%@len[%@name[%1]] - 4]]
echo %@upper[%Z]
@pkzip -uqc 4DVC%VCZIP.ZIP %Z >&! NUL
if %? EQ 0 @del /q %Z >&! NUL
set VCZIP=
return