home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / msh21b.zip / MSHFILES.ZIP / ARJZIP.MSH < prev    next >
Text File  |  1992-08-13  |  4KB  |  139 lines

  1. | Actions defined when the panel shows a zip or arj archive.
  2. |
  3. (panel.pattern dirpart current.name&"\\*.*"&panel.pattern!)extension_zip!
  4. (extension_zip)extension_arj!
  5. |
  6. (panel.pattern panel.type cutfirst drop panel.type&)archive_name!
  7. |
  8. (panel.pattern panel.type cutlast swap drop dirpart dup 
  9.  length dup 1>(2 swap substring)(drop drop "")ifelse
  10. )archive_dirname!
  11. |
  12. ( current.isdir
  13.   ( panel.pattern dirpart
  14.     current.name ".." =
  15.     (dup length 1- 1 swap substring dirpart)
  16.     (current.name&)
  17.     ifelse
  18.     panel.pattern filepart makename
  19.     panel.pattern!
  20.   )
  21.   if
  22. )cur_action.zip!
  23. |
  24. (cur_action.zip)cur_action.arj!
  25. |
  26. ( panel.pattern dirpart
  27.       dup length 1- 1 swap substring dirpart
  28.       panel.pattern filepart makename
  29.       panel.pattern!
  30. )go_up.zip!
  31. |
  32. (go_up.zip)go_up.arj!
  33. |
  34. (tmp_dir tempname)tmp_filename!
  35. |
  36. ( tmp_filename swap archive_name&" "&archive_dirname&
  37.   current.name&">"&2 pick&(exec)with_nomagic
  38.   dup pager unlink
  39. )browse_in_archive!
  40. |
  41. ("pkunzip -c -d "browse_in_archive)browse.zip!
  42. |
  43. ("arj p "browse_in_archive)browse.arj!
  44. |
  45. ( tmp_filename ""
  46.   ( archive_dirname swap&
  47.     panel.type ".zip"=
  48.     (("\\" cutfirst dup (dup)if)("/" swap & &)while)if || replace "\" by "/"
  49.     nl&& false current.selected!)foreachselected
  50.   2 pick write
  51. )make_responsefile!
  52. |
  53. ("delete from current archive:"nl&selected_list&ok
  54.  ( make_responsefile
  55.      "pkzip -d -b" tmp_dir unit_and_name drop& " "&archive_name&" @"
  56.    &2 pick&execute unlink reread
  57.  )if
  58. )delete.zip!
  59. |
  60. ("delete from current archive:"nl&selected_list&ok
  61.  ( make_responsefile
  62.      "arj d -w" tmp_dir& " "&archive_name&" !"
  63.    &2 pick&execute unlink reread
  64.  )if
  65. )delete.arj!
  66. |
  67. ("copy from current archive to "next_dir&":"&nl&selected_list&ok
  68.  ( make_responsefile
  69.    "arj e " archive_name & " " & next_dir & "\\ !" 
  70.    &2 pick&execute unlink reread_next
  71.  )if
  72. )copy.arjto!
  73. |
  74. ("copy from current archive to "next_dir&":"&nl&selected_list&ok
  75.  ( make_responsefile
  76.    "pkunzip " archive_name & " "& next_dir&dup "\\" endsby("\\"&)ifnot
  77.    " @" &2 pick&execute unlink reread_next
  78.  )if
  79. )copy.zipto!
  80. |
  81. ("move from current archive to "next_dir&":"&nl&selected_list&ok
  82.  ( make_responsefile
  83.    "arj e -d -w"tmp_dir& " "& archive_name & " " & next_dir & "\\ !" 
  84.    &2 pick&execute unlink reread reread_next
  85.  )if
  86. )move.arjto!
  87. |
  88. ("move from current archive to "next_dir&":"&nl&selected_list&ok
  89.  ( make_responsefile
  90.    "pkunzip " archive_name & " "& next_dir&"\\ @"
  91.    &2 pick&execute
  92.    "pkzip -d -b" tmp_dir unit_and_name drop& " "&archive_name&" @"
  93.    &2 pick&execute unlink reread reread_next
  94.  )if
  95. )move.zipto!
  96. |
  97. ((archive_dirname)in_next_panel dup 
  98.  ("warning"
  99.   "you can only move or copy files to the top level in an archive"message
  100.  )if
  101.  not
  102. )test_top_level_in_archive!
  103. |
  104. (test_top_level_in_archive
  105.  ("copy to archive "next_dir&":"&nl&selected_list&ok
  106.   ( make_responsefile
  107.     "arj a -w"tmp_dir&" "&(archive_name)in_next_panel&" !"
  108.     &2 pick&execute unlink reread_next
  109.   )if
  110.  )if
  111. )copyto.arj!
  112. |
  113. (test_top_level_in_archive
  114.  ("copy to archive "next_dir&":"&nl&selected_list&ok
  115.   ( make_responsefile
  116.     "pkzip -a -b"tmp_dir unit_and_name drop&" "&(archive_name)in_next_panel&" @"
  117.     &2 pick&execute unlink reread_next
  118.   )if
  119.  )if
  120. )copyto.zip!
  121. |
  122. (test_top_level_in_archive
  123.  ("move to archive "next_dir&":"&nl&selected_list&ok
  124.   ( make_responsefile
  125.     "arj m -w"tmp_dir&" "&(archive_name)in_next_panel&" !"
  126.     &2 pick&execute unlink reread reread_next
  127.   )if
  128.  )if
  129. )moveto.arj!
  130. |
  131. (test_top_level_in_archive
  132.  ("move to archive "next_dir&":"&nl&selected_list&ok
  133.   ( make_responsefile
  134.     "pkzip -m -b"tmp_dir unit_and_name drop&" "&(archive_name)in_next_panel&" @"
  135.     &2 pick&execute unlink reread reread_next
  136.   )if
  137.  )if
  138. )moveto.zip!
  139.