home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / swapper.cmd < prev    next >
OS/2 REXX Batch file  |  1993-06-21  |  2KB  |  46 lines

  1. /*****************************************************************/
  2. /*  This Rexx procedure will keep an eye on the SWAPPER.DAT file */
  3. /*  by checking the size every 30 seconds.  If the size changes  */
  4. /*  a message is displayed and the user is asked to whether to   */
  5. /*  Continue or Exit                                             */
  6. /*                                                               */
  7. /*  Written by:   Clay Baker                                     */
  8. /*  Date:         06/18/93                                       */
  9. /*  Modificatons:                                                */
  10. /*                                                               */
  11. /*****************************************************************/
  12. HFsize = 0                    /* Initialize work variables*/
  13. First_Time = 'Yes'
  14.  
  15. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'  /* Load Rexx */
  16. call SysLoadFuncs                                          /* Functions */
  17. call SysCls                            /* Clear Screen (in case running */
  18.                                        /* in full screen mode)          */
  19.                
  20. Check_File:
  21. call SysSleep 30                                             /*  Wait 30 seconds */
  22. call SysFileTree 'c:\OS2\SYSTEM\SWAPPER.Dat','Findfile','F'  /*  Get Swapper file info */
  23. push Findfile.1
  24. pull Fdate Ftime Fsize Fattrb Fname
  25. If First_time = 'Yes' then do
  26.   First_time = 'No'
  27.   HFsize = Fsize
  28. End
  29. Select
  30.   When Fsize > HFsize then Action = 'increased'
  31.   When Fsize < HFsize then Action = 'decreased'
  32.   Otherwise Action = ' '
  33. End
  34. If Action <> ' ' then do    /* If file size has changed */
  35.   call File_Changed         /* Call msg Routine */
  36.   HFsize = Fsize
  37.  end
  38. Signal Check_File
  39.    
  40. File_Changed:
  41. Msg='Swapper has' Action 'to' Fsize 'bytes.  Should I continue to Monitor?'
  42. If RxMessageBox(Msg,"Question", "YesNo", "Question") = 7 
  43.   Then Exit
  44. else
  45.   NOP
  46. Return