On Wed, 14 Jul 2004, David Cantrell wrote:

Tal Cohen wrote:
I know, but that is what I am stuck with (besides, what is wrong with
writing platform independent code?). I could use a Windows/DOS batch
command...if I knew which one to use.

mem, I think.

Yes, this seems to work -- sort of:

    % ssh $windows_host_FOO_with_cygwin_ssh_set_up
    [EMAIL PROTECTED]'s password:
    Last login: Wed Jul  7 19:14:00 2004 from bar
    [EMAIL PROTECTED] ~
    $ mem /?
    Displays the amount of used and free memory in your system.

    MEM [/PROGRAM | /DEBUG | /CLASSIFY]

      /PROGRAM or /P   Displays status of programs currently loaded in memory.
      /DEBUG or /D     Displays status of programs, internal drivers, and other
                       information.
      /CLASSIFY or /C  Classifies programs by memory usage. Lists the size of
                       programs, provides a summary of memory in use, and lists
                       largest memory block available.

    [EMAIL PROTECTED] ~
    $ mem


655360 bytes total conventional memory 655360 bytes available to MS-DOS 632720 largest executable program size

       1048576 bytes total contiguous extended memory
             0 bytes available contiguous extended memory
        941056 bytes available XMS memory
               MS-DOS resident in High Memory Area

    [EMAIL PROTECTED] ~
    $ mem /classify

    Conventional Memory :

      Name                Size in Decimal       Size in Hex
    -------------      ---------------------   -------------
      MSDOS              12080      ( 11.8K)       2F30
      KBD                 3280      (  3.2K)        CD0
      HIMEM               1248      (  1.2K)        4E0
      COMMAND             4272      (  4.2K)       10B0
      FREE                 112      (  0.1K)         70
      FREE              634192      (619.3K)      9AD50

    Total  FREE :       634304      (619.4K)

    Upper Memory :

      Name                Size in Decimal       Size in Hex
    -------------      ---------------------   -------------
      SYSTEM            163824      (160.0K)      27FF0
      MOUSE              12528      ( 12.2K)       30F0
      MSCDEXNT             464      (  0.5K)        1D0
      REDIR               2672      (  2.6K)        A70
      DOSX               34848      ( 34.0K)       8820
      FREE                1456      (  1.4K)        5B0
      FREE               46208      ( 45.1K)       B480

    Total  FREE :        47664      ( 46.5K)

    Total bytes available to programs (Conventional+Upper) :   681968   (666.0K)
    Largest executable program size :                          632736   (617.9K)
    Largest available upper memory block :                      46208   ( 45.1K)

       1048576 bytes total contiguous extended memory
             0 bytes available contiguous extended memory
        941056 bytes available XMS memory
               MS-DOS resident in High Memory Area

    $

So, if you have ssh set up, and can use ssh-agent to cache the password, then it appears you can get a nicely parseable display of memory usage.

As long as you're happy with memory available to DOS that is. :-/

But hey, 666.0K ought to be enough for anybody! :-)


-- Chris Devers _______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to