home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / os2v1.zip / SW1.TXT < prev   
Text File  |  1994-03-26  |  3KB  |  67 lines

  1.  
  2. SQZMEM.CMD v1.00b
  3.  
  4. AUTHOR: Andrew McElroy (RIME OS/2 Conference NODE "->MIDAS")
  5. ════════════════════════════════════════════════════════════
  6.  
  7. PURPOSE: Cause RAM Compression under OS/2 2.x.
  8.  
  9.  NOTES:
  10.  - The program will report a size that the swap file grew to when it ends.
  11.    However, the swap file may actually grow larger after the program reports
  12.    it's findings.  This is normal.
  13.  - Before running this program, you should be sure there is sufficient room
  14.    for the swap file to grow by approximate 2-6MB.
  15.  - The location of the swapper file MUST be customized for each system in
  16.    order for this to work.  This is done because on some systems, there can
  17.    be more than one SWAPPER.DAT file due to not deleting the old one after
  18.    changing CONFIG.SYS to point to a new location.
  19.                                ----------
  20.  This program is placed in the public domain.  However, if you modify it, I
  21.  request that you add your name after mine in the author field before
  22.  distribution.
  23.  
  24. ****************************************************************************/
  25.  
  26. SwapPath="F:\OS2\SYSTEM\SWAPPER.DAT";
  27.  
  28. call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree';
  29. call RxFuncAdd 'SysCls',      'RexxUtil', 'SysCls';
  30. call RxFuncAdd 'SysSleep',    'RexxUtil', 'SysSleep';
  31.  
  32. call SysCls; SAY 'SQZMEM Starting...'
  33. call SysFileTree SwapPath, 'save', 'F';
  34.  
  35. if save.0 = 1 then do
  36.    PARSE VAR save.1 SaveDate SaveTime SaveSize SaveAttr SavePath;
  37.    SAY SavePath 'started at' SaveSize;
  38.    end
  39. else do
  40.    SAY ''; SAY 'ERROR:' SwapPath 'was not found.'; SAY '';
  41.    SAY '  SQZMEM.CMD must be customized to point to the location';
  42.    SAY '  of your swapper.dat file.  Edit SQZMEM.CMD and change the';
  43.    SAY '  location specified in the SwapPath variable.';
  44.    CALL BEEP 524,125; exit(0);
  45.    exit (1);
  46.    end
  47.  
  48. DO outer=1 to 999
  49.    DO inner = 1 to 1000
  50.       x.outer.inner = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456";
  51.    end inner
  52.    call SysFileTree SwapPath, 'file', 'F'
  53.    PARSE VAR file.1 FileData FileTime FileSize FileAttr FilePath;
  54.    say 'At iteration' outer', swapper.dat is' FileSize
  55.    if SaveSize \= FileSize then do
  56.       say FilePath '   grew to' FileSize;
  57.       call RxFuncDrop 'SysFileTree';
  58.       call RxFuncDrop 'SysCls'; call RxFuncDrop 'SysSleep';
  59.       exit (0);
  60.    end
  61.    call SysSleep 1;
  62. end outer;
  63. SAY 'Efficient RAM compression through swap file usage did not occur.'
  64. call RxFuncDrop 'SysFileTree'
  65. call RxFuncDrop 'SysCls'
  66. Exit (2);
  67.