home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
Aminet
/
biz
/
dopus
/
Dopus511.lha
/
dopus_pch.lha
/
ARexx.lha
/
Arexx
/
FIDList.dopus5
< prev
next >
Wrap
Text File
|
1995-06-10
|
3KB
|
109 lines
/*
$VER: FIDList.dopus5 1.2 (10.6.95)
Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
ARexx script for Directory Opus 5 to list all selected files in the source
with their 'FILE_ID.DIZ' description.
Call as: <ARexx> DOpus:arexx/FIDList.dopus5 {Qp}
*/
outfile='T:FIDList.txt' /* path and filename of File ID List to generate */
parse arg portname .
if portname='' then /* in case they forgot */
portname='DOPUS.1'
address value portname
options results
options failat 21
lf='0a'x
lister query source
if rc>0 then
exit
parse var result handle . /* only need first source */
lister set handle busy on
lister query handle path
srcpath=result
lister query handle selfiles stem files.
lister set handle progress files.count 'Making File ID List...'
lister set handle title 'Making File ID List...'
lister refresh handle full
call open('output',outfile,'w')
call writeln('output',"File ID List of '"srcpath"' on" date('n'))
call writeln('output','')
if exists('T:FILE_ID.DIZ') then
address command 'Delete >NIL: T:FILE_ID.DIZ QUIET'
do i=0 to files.count-1
lister query handle abort
if result then
signal quitit
lister set handle progress count i+1
lister set handle progress name files.i
lister query handle entry files.i stem fileinfo.
beginline=left(fileinfo.name,31-length(fileinfo.size))' 'fileinfo.size
thisfile='"'srcpath||fileinfo.name'"'
ext=reverse(fileinfo.name)
parse var ext ext '.'
ext=upper(reverse(ext))
if ext='LHA'|ext='LZH'|ext='RUN' then
address command 'LhA >NIL: e -q -x0 -Qw -Qo' thisfile 'T: FILE_ID.DIZ'
if ext='LZX' then
address command 'LZX >NIL: x' thisfile 'FILE_ID.DIZ T:'
if ext='DMS' then
address command 'DMSDescript >NIL: x T:FILE_ID.DIZ' thisfile
if ext='README' then do /* Aminet description */
call open('readme',srcpath||fileinfo.name,'r')
desc=readln('readme')
close('readme')
parse var desc ':' desc
beginline=beginline strip(desc,'b')
end
if open('fileid','T:FILE_ID.DIZ','r') then do
do while ~eof('fileid')
idline=compress(readln('fileid'),'0d1a'x)
if ~(idline==''&eof('fileid')) then do
call writeln('output',beginline idline)
beginline=copies(' ',32)
end
end
call close('fileid')
address command 'Delete >NIL: T:FILE_ID.DIZ QUIET'
end
else
call writeln('output',beginline)
lister select handle '"'fileinfo.name'"' off /* deselect file */
end
signal quitit
quitit:
lister set handle title /* reset title text */
lister refresh handle full
lister set handle busy off
call close('output')
command read outfile /* display generated File ID List */