home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: PopUpDisk.dopus5 1.0 (15.2.95)
- Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
-
- ARexx script for the Directory Opus 5.5 'Disk inserted' script.
- Function : ARexx DOpus5:ARexx/PopUpDisk.dopus5
-
- Also, set both the 'Disk removed' and 'Startup' script to:
- Function : AmigaDOS C:Info >T:DeviceInfo
- */
-
- options results
- address dopus.1
- options failat 21
- lf='0a'x
-
- if ~exists('T:DeviceInfo') then do
- address command 'Info >T:DeviceInfo'
- exit
- end
-
- call open('devlist','T:DeviceInfo','r')
- do 3
- call readln('devlist')
- end
- n=0
- do until thisline=''
- n=n+1
- thisline=readln('devlist')
- parse var thisline oldunit.n . . . . . . oldname.n
- end
- call close('devlist')
-
- address command 'Info >T:DeviceInfo'
- call open('devlist','T:DeviceInfo','r')
-
- do 3
- call readln('devlist')
- end
- do until thisline=''
- thisline=readln('devlist')
- parse var thisline unit . . . . . . name
- do i=1 to n
- flag=(unit=oldunit.i)
- if flag then do
- if name~==oldname.i then
- if name=='' then do /* disk removed */
- lister query all stem handle.
- if rc=0&handle.count>0 then
- do i=0 to handle.count-1
- lister query handle.i path
- parse var result device ':'
- if device':'=unit then
- lister close handle.i
- end
- end
- else /* new disk inserted */
- signal promptdisk
- leave
- end
- end
- if ~flag&name~=='' then /* new device mounted */
- signal promptdisk
- end
- call close('devlist')
- exit
-
-
- promptdisk:
-
- call close('devlist')
-
- lister query all stem handle.
- if rc=0&handle.count>0 then do
- flag=0
- do i=0 to handle.count-1
- lister query handle.i path
- thispath=result
- parse var thispath device ':'
- if device':'=unit then do
- flag=1
- if exists(thispath) then
- lister read handle.i thispath
- else
- lister read handle.i unit
- end
- end
- if flag then
- exit
- end
-
- dopus front
- dopus request '"New disk inserted in unit' unit'.'lf'In which lister do you want to read the directory?" New|Source|Dest|Cancel'
- if rc=1 then
- lister new unit
- if rc=2 then do
- lister query source
- parse var result handle .
- lister read handle unit
- end
- if rc=3 then do
- lister query dest
- parse var result handle .
- lister read handle unit
- end
-