Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
most probably pslist from sysinternals.com (NB: it’s worth looking at
other tools there as well)
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
I always liked PsTools from sysinternals. I don’t know the exact
output of it (don’t have a windows pc at hand), but I think this is
what you are looking for: http://www.sysinternals.com/Utilities/PsList.html
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
There isn’t one. Have you considered installing Linux? Commands like
“ps”
are not platform-portable.
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
TIA
Stuart
See sys-proctable, available on the RAA, which serves as a
cross-platform solution to boot.
FYI, there are actually seven different ways to get process table
information on Windows, none of which are quite the same, and one of
which is undocumented. The sys-proctable version uses OLE + WMI on
Windows.
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
TIA
Stuart
I’ve seen some of the responses to this post, and I’m really curious.
Which books use examples that require “ps”, and could you give some
examples of the use of “ps” in a Ruby script/program?
The reason I bring this up is that there are some times when doing “ps”
in a script is a very bad idea. Textbook examples that are OS-dependent
don’t impress me all that much, either, outside of the obligatory “how
to get up and running on Windows, Linux, MacOS and Solaris” chapters.
I’ve seen some of the responses to this post, and I’m really curious.
Which books use examples that require “ps”, and could you give some
examples of the use of “ps” in a Ruby script/program?
The reason I bring this up is that there are some times when doing “ps”
in a script is a very bad idea. Textbook examples that are OS-dependent
don’t impress me all that much, either, outside of the obligatory “how
to get up and running on Windows, Linux, MacOS and Solaris” chapters.
I don’t have my win pc at hand but you can try CygWin - its a pretty
comprehensive set of *nix tools and it may have a ps you can use.
Sorry, but googling doesn’t seem to be leading me anywhere. I have a
number o Ruby examples from books that demonstrate things using the
Unix ps command for system status. Can someone please tell me what is
the equivalent call in the Windows environment ?
If you are on WinXP (maybe also Win2k), try tasklist
I’ve been using it in a utility to monitor what apps I use.
tasklist /V
will report on these fields:
Image Name
PID
Session Name
Session#Mem Usage
Status
User Name
CPU Time
Window Title
Well off the top of my head right now -
The first recipe in Ruby Cookbook - in the Rails chapter
I don’t have that one handy, but I’ll look it up
Second -
AWDWR 2nd edition in the Web2.0 Chapter.
Yeah … page 513 in my Beta PDF. Comments:
Yeah, it’s “UNIX” specific, and it says so in the text.
It’s demonstrating regular updates and the “backquote” operator. I
assume the backquote works on Windows, so a better example might be some
command that would work on Windows, Linux and MacOS. Just off the top of
my head, the only thing I can recall is
more logfile.txt
Depending on the frequency and the number of processes, doing that
“ps” can impact performance severely. “ps -a” lists all the processes
running on the system. You don’t want to do this on a system with
several thousand processes!
If the application requirements specifically call for that
functionality, there are usually better tools available. If not, it’s
exposing some system internals to an end user that probably are either
uninteresting or none of their (expletive deleted) business. “ps” is a
command line system administration tool.
There are worse versions of the “ps” command than “ps -a”. For
example, “ps -vax” or “ps -uax” does a sort on all the processes! Take
your system with thousands of processes and sort all those lines every
two seconds? Not on my server, please!!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.