home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / sysba021.zip / SRC.ZIP / sysbar2 / Piper / reporter.cmd < prev    next >
OS/2 REXX Batch file  |  1999-10-13  |  2KB  |  55 lines

  1. /*
  2. **  An information source example for SysBar/2 Pipe monitor
  3. **
  4. **  Just change some entries for your own needs, add appropriate pipes
  5. **    in the pipe monitor and enjoy... :)
  6. */
  7. '@echo off'
  8. call RxFuncAdd 'SysDriveInfo', 'RexxUtil', 'SysDriveInfo';
  9. call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree';
  10. call RxFuncAdd 'SysSleep', 'RexxUtil', 'SysSleep';
  11. do forever
  12.   call ReportDriveSpace '\pipe\sb2_drive_c' SysDriveInfo( 'C:' )
  13.   call ReportDriveSpace '\pipe\sb2_drive_d' SysDriveInfo( 'D:' )
  14.   call ReportFileSize '\pipe\sb2_swap' 'd:\os2\system\swapper.dat' 'Sw'
  15.   call ReportFileCount '\pipe\sb2_fido' 'd:\comm\fido\xenia\inbound\*' 'Inbound'
  16.   call ReportFileCount '\pipe\sb2_mail' 'd:\comm\southsde\pmmail\dip_l321.act\inbox.fld\*.msg' 'Mail'
  17.   call SysSleep 5
  18. end
  19. exit;
  20.  
  21. /*
  22. **  Drive space reporter
  23. **  Usage: ReportDriveSpace( _pipename_,  _driveinfo_ )
  24. **    the _driveinfo_ parameter is the result of SysDriveInfo call
  25. */
  26. ReportDriveSpace:
  27.   parse arg sPipeName sDrive sFree sRest
  28.   iSpace = sFree % 1048576
  29.   'echo 'sDrive''iSpace' > 'sPipeName
  30. return;
  31.  
  32. /*
  33. **  File count reporter
  34. **  Usage: ReportFileCount( _pipename_,  _filemask_, _comment_ )
  35. */
  36. ReportFileCount:
  37.   parse arg sPipeName sDir sName
  38.   call SysFileTree sDir, aRes, 'F'
  39.   if aRes.0 > 0 then 'echo 'sName': 'aRes.0' > 'sPipeName;
  40.   else 'echo.> 'sPipeName;
  41. return;
  42.  
  43. /*
  44. **  File size reporter
  45. **  Usage: ReportFileSize( _pipename_,  _filename_, _comment_ )
  46. */
  47. ReportFileSize:
  48.   parse arg sPipeName sFile sName
  49.   call SysFileTree sFile, aRes, 'F'
  50.   parse var aRes.1 sTime sDate sSize sRest
  51.   iSize = sSize % 1048576
  52.   'echo 'sName': 'iSize' > 'sPipeName;
  53. return;
  54.   
  55.