Posted By

reboltutorial on 04/23/10


Tagged

line Rebol7zipCommand


Versions (?)

Zip a directory with 7zip


 / Published in: Bash
 

URL: http://reboltutorial.com/index.php?s=shell

7zip by command line

  1. SevenZip-Path: "C:\Program Files\7-Zip\7z.exe"
  2.  
  3. zip-directory: func[zip-file-name directory /encrypt /targetdir _targetdir /local secret][
  4. var1: to-local-file zip-file-name
  5. var2: directory
  6. ;call rejoin [quote SevenZip-Path " a -tzip " quote (to-local-file zip-file-name) quote directory "\*"]
  7.  
  8. if/else encrypt [
  9. secret: ask "secret key: "
  10. if/else targetdir [
  11. make-dir/deep to-rebol-file _targetdir
  12. call temp: rejoin [quote SevenZip-Path " -p" secret " a -tzip " quote rejoin [_targetdir "\" var1] " " quote rejoin [var2 "\*"]]
  13. ][
  14. call rejoin [quote SevenZip-Path " -p" secret " a -tzip " quote var1 " " quote rejoin [var2 "\*"]]
  15. ]
  16.  
  17. ][
  18. if/else targetdir [
  19. make-dir/deep to-rebol-file _targetdir
  20. call rejoin [quote SevenZip-Path " a -tzip " quote rejoin [_targetdir "\" var1] " " quote rejoin [var2 "\*"]]
  21. ][
  22. call rejoin [quote SevenZip-Path " a -tzip " quote var1 " " quote rejoin [var2 "\*"]]
  23. ]
  24. ]
  25. ]

Report this snippet  

You need to login to post a comment.