home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / packer / zip4 / difzip4.btm < prev    next >
Text File  |  1993-11-26  |  1KB  |  47 lines

  1. :: Usage: difzip4 filename [zipfile [fcarg1 fcarg2 ...]]
  2.  
  3. :: This command shows differences between the file FILENAME in the current
  4. :: directory and FILENAME in zip file %ZIP4BAK\ZIPFILE. The second argument,
  5. :: ZIPFILE, is optional. If not present DIFZIP4 will search all zip files in
  6. :: %ZIP4BAK until it finds FILENAME. If present, either %ZIP4BAK\ZIPFILE or
  7. :: ZIPFILE is acceptable. The remaining arguments, FCARGs, are passed to 
  8. :: FC.EXE.
  9.  
  10. @echo off
  11. *setlocal
  12. *set ziplist=%2
  13. :: If user didn't specify a zipfile, use *.zip. DIFZIP4 will search
  14. :: all .zip files for %1. It will stop searching at the first zip file
  15. :: that contains %1.
  16. iff .%2 == . then
  17.  *set ziplist=*
  18. else
  19.  :: Otherwise, get rid of path and extension (Note: assumes .zip extension).
  20.  *set ziplist=%@name[%ziplist]
  21. endiff
  22.  
  23. :: If zip4bak envrionment variable doesn't exist then set it to default.
  24. iff .%zip4bak == . then
  25.  set zip4bak=\zip4bak
  26. endiff
  27.  
  28. for %%zipfile in (%zip4bak\%ziplist.zip) gosub unzipit
  29.  
  30. quit
  31.  
  32. :unzipit
  33. :: Unzip %1 from %zipfile into the zip4bak directory.
  34.  
  35. unzip4.exe %zipfile %1 -o %zip4bak\
  36. if %? == 0 goto :diffit
  37. :: unzip4 did not exit normally
  38. return
  39.  
  40. :diffit
  41. :: Find the differences between %1 and %zip4bak\%1. We are using fc.exe, but
  42. :: any "diff" program may be substituted.
  43. :: You may want to TEE the output of FC to another file, e.g. TEMP.DIF
  44. fc /n %3& %1 %zip4bak\%1 | list /s
  45. quit
  46.  
  47.