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 / 4DVCBKP2.BTM < prev    next >
Text File  |  1991-01-04  |  6KB  |  144 lines

  1. @echo off
  2.    if not exist %1 quit
  3.    set VCNAM=%@upper[%@name[%1]]
  4.    set VCEXT=%@upper[%@ext[%1]]
  5. rem ****** No existing ZIP file yet?
  6.    iff not exist 4DVC%VCEXT.ZIP then
  7.       set VCVER=001
  8.       goto CHKVER
  9.    endiff
  10. rem ****** get dates for ZIP and current files
  11.    @pkzip -vbdr 4DVC%VCEXT.ZIP %VCNAM.* >! 4DVC.0
  12.    @dir /CF %VCNAM.%VCEXT >! 4DVC.1
  13.    set VCDATEZ=%@substr[%@line[4DVC.0,9],35,2]%@substr[%@line[4DVC.0,9],29,2]%@substr[%@line[4DVC.0,9],32,2]
  14. rem ****** No date for ZIP file? must be empty ZIP file; treat as new.
  15.    iff "%VCDATEZ" EQ "" then
  16.       set VCVER=001
  17.       goto CHKVER
  18.    endiff
  19.    iff "%@substr[%@line[4DVC.1,3],23,1]" EQ " " then
  20.       set VCDATED=%@substr[%@line[4DVC.1,3],29,2]0%@substr[%@line[4DVC.1,3],24,1]%@substr[%@line[4DVC.1,3],26,2]
  21.    else
  22.       set VCDATED=%@substr[%@line[4DVC.1,3],29,2]%@substr[%@line[4DVC.1,3],23,2]%@substr[%@line[4DVC.1,3],26,2]
  23.    endiff
  24.    set VCTIME=%@substr[%@line[4DVC.1,3],33,5]
  25.    if "%@substr[%@line[4DVC.1,3],33,1]" EQ " " set VCTIME=0%@substr[%@line[4DVC.1,3],34,4]
  26.    if "%@substr[%@line[4DVC.1,3],34,1]" EQ " " set VCTIME=00:00
  27. rem ****** ZIP date < current?
  28.    if "%VCDATEZ" LT "%VCDATED" goto CALCVER
  29. rem ****** ZIP date > current?
  30.    if "%VCDATEZ" GT "%VCDATED" goto NOARCH
  31. rem ****** dates equal: check time stamp
  32.    iff "%@substr[%@line[4DVC.0,9],39,5]" LT "%VCTIME" then
  33.       set VCTIME=
  34.       goto CALCVER
  35.    endiff
  36. :NOARCH
  37.    echo 
  38.    cls
  39.    set VCDATEZ=
  40.    set VCDATED=
  41.    drawbox 0  0  9 79 2 yel on bla fill bla
  42.    scrput  2  2 bri yel on bla Bypassing archive request                        4DVC%VCEXT.ZIP contains
  43.    scrput  2 28     yel on bla for file               4DVC%VCEXT.ZIP contains
  44.    scrput  2 37 bri yel on bla %VCNAM.%VCEXT.
  45.    scrput  3  2     yel on bla an entry which is dated equal to or more recently than the DOS date stamp
  46.    scrput  4  2     yel on bla on file               Press a key to continue.
  47.    scrput  4 10 bri yel on bla %VCNAM.%VCEXT.
  48.    scrput  6  7     yel on bla Archive-File =              %@substr[%@line[4DVC.0,9],29,8] %@substr[%@line[4DVC.0,9],39,5]
  49.    scrput  6 22 bri yel on bla %@substr[%@line[4DVC.0,9],46,12]
  50.    scrput  7  7     yel on bla Current-File =              %@substr[%@line[4DVC.1,3],23,8] %VCTIME
  51.    scrput  7 22 bri yel on bla %VCNAM.%VCEXT
  52.    screen  4 48
  53.    set VCTIME=
  54.    inkey /W180 %%VCRESP
  55.    goto WRAPUP
  56. :CALCVER
  57.    set VCTIME=
  58.    set VCDATEZ=
  59.    set VCDATED=
  60. rem ****** bump the version number of the most recent archive by 1
  61.    set VCVER=%@substr[%@line[4DVC.0,9],2,-3]
  62.    set VCVER=%@eval[%VCVER + 1]
  63.    if %@len[%VCVER] EQ 0 set VCVER=001
  64.    if %@len[%VCVER] EQ 1 set VCVER=00%VCVER
  65.    if %@len[%VCVER] EQ 2 set VCVER=0%VCVER
  66.    if %@len[%VCVER] EQ 4 set VCVER=000
  67. :CHKVER
  68.    iff exist %VCNAM.%VCVER then
  69.       echo 
  70.       cls
  71.       drawbox 0  0 16 79 2 bri whi on red fill red
  72.       scrput  2  2 bri whi on red Cannot archive %VCNAM.%VCEXT.
  73.       scrput  2 31     whi on red 4DVC relies upon the availability of filenames
  74.       scrput  3  2     whi on red that end in 000 thru 999 (numeric, inclusive). This is because the file to
  75.       scrput  4  2     whi on red be archived in a .ZIP file (via PKZIP) must already be named exactly
  76.       scrput  5  2     whi on red what you want it to be (you cannot archive              and then rename
  77.       scrput  5 45 bri whi on red %VCNAM.%VCEXT
  78.       scrput  6  2     whi on red it inside the .ZIP file). Therefore, the file must be renamed before
  79.       scrput  7  2     whi on red it is archived, archived under the new name, then renamed back to what
  80.       scrput  8  2     whi on red it was originally called. YOU HAVE A FILE IN THE DEFAULT DIRECTORY CALLED
  81.       scrput  9  2 bri whi on red %VCNAM.%VCVER.
  82.       scrput  9 16     whi on red RATHER THAN ERRONEOUSLY DELETE THAT FILE,
  83.       scrput  9 58 bri whi on red %VCNAM.%VCEXT
  84.       scrput 10  2     whi on red WILL NOT BE ARCHIVED. You may either delete files that end with .000
  85.       scrput 11  2     whi on red thru .999, or copy your other files to be archived to another directory
  86.       scrput 12  2     whi on red and archive them from there.
  87.       scrput 14 27 bri whi on red Press a key to continue.
  88.       screen 14 50
  89.       inkey /W180 %%VCRESP
  90.       goto WRAPUP
  91.    endiff
  92.    cls
  93.    drawbox 0  0  7 79 2 whi on blu fill blu
  94.    scrput  2  9 bri whi on blu About to archive %VCNAM.%VCEXT
  95.    scrput  2 39     whi on blu as              in 4DVC%VCEXT.ZIP.
  96.    scrput  2 42 bri whi on blu %VCNAM.%VCVER
  97.    scrput  3 10     whi on blu Please enter a 40-character comment, or accept the default:
  98.    scrput  5 13 bri whi on blu Comment: [                                          ]
  99.    screen  5 24 `                                        `
  100.    screen  5 24
  101. rem locate existing file description, or supply default if none
  102.    set VCRCD=
  103.    iff exist DESCRIPT.ION then
  104.       set VCRCD=0
  105.    else
  106.       goto NODESC
  107.    endiff
  108. :FINDDESC
  109.    iff "%@line[DESCRIPT.ION,%VCRCD]" EQ "" then
  110. :NODESC
  111.       set VCRCD=
  112.       keystack "%VCCOM %VCNAM.%VCEXT" @71
  113.       goto USERDESC
  114.    endiff
  115.    iff %@index["%@upper[%@line[DESCRIPT.ION,%VCRCD]]",%VCNAM.%VCEXT] EQ 1 then
  116.       keystack "%@substr["%@line[DESCRIPT.ION,%VCRCD]                                         ",%@eval[%@len[%VCNAM.%VCEXT]+2],40]" @71
  117.    else
  118.       set VCRCD=%@eval[%VCRCD + 1]
  119.       goto FINDDESC
  120.    endiff
  121. :USERDESC
  122. rem Description determined. Present to user for modification/acceptance.
  123.    input %%VCRESP
  124.    @ren /q %1 %VCNAM.%VCVER
  125.    iff "%VCRESP" EQ "" then
  126.       iff "%VCRCD" EQ "" then
  127.          keystack "%VCCOM %VCNAM.%VCEXT" 13
  128.       else
  129.          keystack "%@upper[%@substr["%@line[DESCRIPT.ION,%VCRCD]                                         ",%@eval[%@len[%VCNAM.%VCEXT]+2],40]]" 13
  130.          set VCRCD=
  131.       endiff
  132.    else
  133.       keystack "%@upper[%VCRESP]" 13
  134.    endiff
  135.    @pkzip -uqc 4DVC%VCEXT.ZIP %VCNAM.%VCVER >! NUL
  136.    @ren /q %VCNAM.%VCVER %1
  137. :WRAPUP
  138.    if exist 4DVC.0 @del /q 4DVC.0 >&! NUL
  139.    if exist 4DVC.1 @del /q 4DVC.1 >&! NUL
  140.    set VCRESP=
  141.    set VCVER=
  142.    set VCEXT=
  143.    set VCNAM=
  144.