home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / opus / v5 / webcache_copy / webcachecopy.lha / WebCacheCopy.dopus5 next >
Text File  |  1997-08-05  |  3KB  |  99 lines

  1. /* $VER: WebCacheCopy 1.0
  2.  ©1997 by mike@kily.ruhr.de (http://kily.home.pages.de)
  3.  
  4.  DOPUS5.5+ Script for copy WWW-Cache files to original name
  5.  
  6.  description:
  7.   The cache files from all currently available Amiga WWW-Browser
  8.   (AWeb/Ibrowse/Voyager) have cache files with filenames like
  9.   0dwsmcdsnefdpmkpgh5csdo3ezeaaa or 00000011.gif or similar.
  10.  
  11.   But they have all the name of there origin in the file comment.
  12.  
  13.   This WebCacheCopy script parses during file copy from source to target dir
  14.   the original filename from the comment and uses this as target-filename.
  15.  
  16.  installation:
  17.   as Button,Menu,...
  18.   NO Parameters, only select: <AREXX> Dopus5:ARexx/WebCacheCopy.dopus5
  19.  
  20.  EmailWare:
  21.   this script is email-ware,
  22.   please mail me your favourit Internet-Site !
  23.  
  24.  
  25. */
  26.  
  27. PARSE ARG portname .
  28.  
  29. IF portname='' THEN portname='DOPUS.1'
  30. ADDRESS VALUE portname
  31.  
  32. OPTIONS RESULTS
  33.  
  34. LISTER QUERY SOURCE
  35. Handle = RESULT
  36. IF RC~=0 THEN DO
  37.  DOPUS REQUEST '"No Source-dir selected !?!" Shit'
  38.  EXIT
  39. END
  40. LISTER QUERY Handle path
  41. pfad = RESULT
  42.  
  43. LISTER QUERY dest
  44. Handle2 = RESULT
  45. IF RC~=0 THEN DO
  46.  DOPUS REQUEST '"No Target-dir selected !?!" Shit'
  47.  EXIT
  48. END
  49. LISTER QUERY Handle2 path
  50. target=result
  51.  
  52. LISTER QUERY Handle selfiles stem files.
  53. IF files.count=0 THEN IF dirs.count=0 THEN EXIT
  54.  
  55.  
  56. LISTER SET handle BUSY ON
  57. LISTER SET handle2 BUSY ON
  58. lister set Handle newprogress name info bar abort
  59. LISTER SET Handle NEWPROGRESS title files.count 'WWW-Cache to Orig-Name Copy...'
  60.  
  61.  
  62. DO i = 0 TO files.count-1
  63.   LISTER QUERY Handle entry files.i stem fileinfo
  64.   LISTER SET Handle NEWPROGRESS title i+1'/'files.count' file in progress...'
  65.   
  66. fileinfo.comment = Compress(fileinfo.comment,'"')
  67. a=lastpos('/',fileinfo.comment)
  68. filename = Right(fileinfo.comment,Length(fileinfo.comment)-a)
  69.  
  70. LISTER SET Handle NEWPROGRESS bar files.count i+1
  71. LISTER SET Handle NEWPROGRESS info ''"'"filename"'"' < '"'"files.i"'"
  72. parse var fileinfo.comment 'http://'hostname'/'
  73. LISTER SET Handle NEWPROGRESS NAME 'Source: 'hostname''
  74.  
  75. LISTER QUERY handle abort
  76.   IF RESULT THEN DO
  77.    LISTER SET handle BUSY OFF
  78.    LISTER SET handle2 BUSY OFF
  79.    LISTER REFRESH handle
  80.    LISTER READ handle2 target
  81.    EXIT
  82.   END
  83.  
  84. do while Exists(target||filename)
  85. filename="!"||filename
  86. end
  87.  
  88. ADDRESS COMMAND 'COPY 'pfad||files.i' to 'target||filename''
  89. ADDRESS COMMAND 'Filenote >nil: 'target||filename '"'fileinfo.comment'"'
  90. LISTER SELECT handle '"'files.i'"' OFF
  91. END
  92.  
  93. LISTER SET handle BUSY OFF
  94. LISTER SET handle2 BUSY OFF
  95. LISTER REFRESH handle
  96. LISTER READ handle2 target
  97.  
  98. EXIT
  99.