home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
opus
/
v4
/
dopus-1541
/
rexx
/
dopus
/
1541
/
1541dir.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1977-12-31
|
2KB
|
98 lines
/*
*
* Enter a 1541 directory from DOpus.
*
* (c) 1995 by Christer Bjarnemo mr.bjarnemo@mn.medstroms.se
*
* Based on Twin-Dopus by Patrick Van Beem (patrick.van.beem@aobh.xs4all.nl),
* which based he's script on the DOpusLhaARexx package by Geoff Seeley.
*
*/
dircmd = "Work:Emulators/A64/Utils/" /* Note. If the file ENVARC:1541.PREFS */
rxdir = "Rexx:Dopus/1541/" /* exists, that one will override the */
tmpdir = "t:" /* settings here... */
DOpusPort = 'DOPUS.1'
if ~show(l,"rexxsupport.library") then
call addlib("rexxsupport.library",0,-30,0)
if showlist('Ports', DOpusPort) = 0 then do
say 'Directory Opus Arexx port not found. Aborting.'
call CleanUp
end
if open(1,'env:1541.prefs','Read') then do
dircmd = readln(1)
rxdir = readln(1)
tmpdir = readln(1)
end
close(1)
dircmd = slashpath(dircmd)
rxdir = slashpath(rxdir)
tmpdir = slashpath(tmpdir)
address(DOpusPort)
ClearWin
busy on
setwintitle '0K'
TopText "Reading 1541 directory..."
address command dircmd'64dir $:* 8 >'tmpdir'_64dir.tmp'
if ~open(1,tmpdir'_64dir.tmp','Read') then do
TopText "ERROR - Couldnt locate tempfile..."
say 'ERROR - Couldnt locate tempfile...'
close 1
exit 20
end
do for 8; dskname = readln(1); end
if dskname ~='' then do
dskname = compress(substr(dskname,6,length(dskname)-9),'"')
end
else do
dskname = 'Disk Error'
end
TopText 'Parsing files from 'dskname'...'
do until eof(1)
tmp = readln(1)
if word(tmp,3) = 'Status:' then status = tmp
if tmp ~= '' then do
fname = subword(tmp,2,words(tmp)-2)
fsize = word(tmp,1)
if fname = 'blocks' then do ; setwintitle quote(fsize/4'K 'dskname) ; fname = '' ; fsize = '' ; end
if left(fname,1) = '"' then do
fname = substr(fname,2,length(fname)-2)
entry = quote(left(fname,30)''right(fsize*256,6)) quote(fname)' -1 -1 1 1'
Addcustentry entry
end
end
end
'DisplayDir -1'
'Addcustentry * 8 -1 -1 0 0'
TopText status
busy off
exit
Quote: procedure
parse arg string
return '"'||string||'"'
/*---------------------------------------------------------------------------*/
Slashpath: procedure /* Put a (/) or (:) at the end of filenames (if neccessary) */
parse arg string
if right(string,1) ~= ':' & right(string,1) ~= '/' then do
string = string'/'
end
return string