home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: ArchiveTest.dopus5 1.2 (1.8.96)
- Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
-
- ARexx script for Directory Opus 5 to test all selected LhA, LZX and DMS
- archives on their data integrity. Corrupt archives are commented to
- indicate this. All archives that were found to be okay are deselected.
-
- Function : ARexx DOpus:ARexx/ArchiveTest.dopus5 {Qp}
- */
-
- parse arg portname .
-
- if portname='' then
- portname='DOPUS.1'
- address value portname
-
- options results
- options failat 21
-
- lf='0a'x
-
- dopus version
- newopus=result~='RESULT' & translate(result,'.',' ')>=5.1236
-
- lister query source
- if rc>0 then
- exit
- parse var result handle .
-
- lister query handle selfiles stem file.
- if file.count=0 then
- exit
-
- lister set handle busy on
-
- lister query handle path
- srcpath=result
-
- lister set handle progress file.count 'Testing archives...'
-
- lister set handle title 'Testing archives...'
- lister refresh handle full
-
- corruptcount=0
-
- do i=0 to file.count-1
- lister query handle abort
- if result then
- signal quitit
-
- lister query handle entry file.i stem fileinfo.
- lister set handle progress name file.i
- lister set handle progress count i+1
-
- thisfile='"'srcpath||fileinfo.name'"'
- ext=reverse(fileinfo.name)
- parse var ext ext '.'
- ext=upper(reverse(ext))
-
- lister select handle '"'fileinfo.name'"' off
- select
- when ext='LHA'|ext='LZH'|ext='RUN' then
- address command 'LhA t -q' thisfile
- when ext='LZX' then
- address command 'LZX >NIL: t' thisfile
- when ext='DMS' then
- address command 'DMS >NIL: TEST' thisfile
- otherwise do
- lister select handle '"'fileinfo.name'"' on
- rc=0
- end
- end
-
- if rc>0 then do
- corruptcount=corruptcount+1
- corruptcomment='Archive corrupt!'
- if newopus then
- command comment name thisfile comment '"'corruptcomment'"'
- else
- command comment name thisfile comment corruptcomment
- lister add handle '"'fileinfo.name'"' fileinfo.size fileinfo.type fileinfo.date fileinfo.protstring corruptcomment
- lister select handle '"'fileinfo.name'"' on
- lister refresh handle full
- command beep
- end
- end
-
-
- quitit:
-
- lister set handle title
- lister clear handle progress
- lister refresh handle full
- if corruptcount=1 then
- word='archive'
- else
- word='archives'
- dopus request '"'corruptcount word 'marked corrupt " OK'
- lister set handle busy off
-