Michael Neumann wrote:

<snip>

> Is ProcTable.ps really of type "Struct"? Or is it an object of an
> user-defined class?

"ps()" is a class method that returns an array of structs.  Each struct
contains such info as pid, ppid, pgid, etc. This is a C extension, btw.

# This stand-alone example works fine
!/usr/bin/ruby
require 'sys/proctable'
include Sys

# List all pids
a = ProcTable.ps
a.each{ |pstruct| puts pstruct.pid.to_s }

>
>
> Does ProcTable.ps return nil under some circumstances.

Impossible.  That would mean *no* processes were running.

>
>
> If that doesn't help, please send me the definition of ProcTable.ps.

The source varies depending on platform (and would be a bit much to post here
anyway), but all platforms return an array of structs.  The struct in
question is called "sProcStruct" and you can view its format within the
Init_proctable() call.

You can find the source at http://www.enteract.com/~mghall/ruby/sys/sys.html

Regards,

Dan

PS - I forgot to mention my platform earlier - Solaris 9