home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
sema4.zip
/
semaphor
/
threads
/
swapinfo.cmd
Wrap
OS/2 REXX Batch file
|
1994-02-17
|
1KB
|
47 lines
ARG window, swapid
/* Do while a semaphore event is posted (equal to 1) */
do while 1
/* Indefinite wait for an event to be posted */
rc=VpSemaphore("EVENT","WAITREQUEST",SWAPID,-1)
/* Get the current drive application variable */
current_drive=VPAppVariable("GET","CDRIVE")
/* Find and display information for the current drive */
result= sysdriveinfo(current_drive)
parse var result drive free size label
/* Set item value Text */
CALL VpSetItemValue window,1007,strip(label)
/* Set item value Text */
CALL VpSetItemValue window,1008,size
/* Set item value Text */
CALL VpSetItemValue window,1009,free
avail = format(100*(free/size),,0)
/* Set item value Text */
CALL VpSetItemValue window,1017,avail'%'
/* FIND SWAPPER.DAT INFO */
os_drive=VPAppVariable("GET","OSDRIVE")
CALL SysFileSearch 'SWAPPATH', os_drive'\config.sys','swap.'
i=swap.0
IF i='' THEN
/* Set item value Text */
CALL VpSetItemValue window,1011,'Not Found'
ELSE DO
parse var swap.i . '=' swappath .
if right(swappath,1)='\' then
swappath=strip(swappath,'t','\')
call sysfiletree swappath||'\swapper.dat','file'
i=file.0
parse var file.i . . value .
/* Set item value Text */
CALL VpSetItemValue window,1011,value
END
/* Reset the EVENT semaphore to 0 */
rc=VpSemaphore("EVENT","RESET",SWAPID)
END