Re: What Is Better than ps (want program name etc)

From: jpd (read_the_sig_at_do.not.spam.it.invalid)
Date: 01/24/05

  • Next message: Bill Marcum: "Re: What Is Better than ps (want program name etc)"
    Date: 24 Jan 2005 10:21:15 GMT
    
    

    Begin <1106407243.414482.197910@f14g2000cwb.googlegroups.com>
    On 2005-01-22, clusardi2k@aol.com <clusardi2k@aol.com> wrote:
    > I can get a lot of useful information about a pid if I use "ps", pipe
    > the info to a file, and read the file, but is there a better way?

    Yes, skip the temporary, that is what pipes are for. (See popen(3), as
    ObOtherPoster already pointed out.)

    > Actually, what I want to do is use the "system" instruction within
    > C/C++ to get this data.

    AFAIK, ps(1) is system-dependent; there is _no_ portable way to get to
    that data other than to read ps output. That is, a ps from NetBSD will
    not necessairily work (or even compile) on solaris, for example.

    (Also: There is no such language as ``C/C++''.)

    -- 
      j p d (at) d s b (dot) t u d e l f t (dot) n l .
    

  • Next message: Bill Marcum: "Re: What Is Better than ps (want program name etc)"

    Relevant Pages

    • _popen "mail -s" unrecognised command
      ... Today I was reading a post and saw some interesting code that uses pipes ... Considering how incredibley easy this appeared to be ... I was fascinated (I've never used pipes, and know less than nothing about ... to compile a console app on VC6. ...
      (alt.comp.lang.learn.c-cpp)
    • Re: pipe implementation on solaris
      ... > Is there semantics difference between the pipes are implemented on ... I have a program which runs fine on Linux ... >however some times on solaris I get some unpredictable results. ...
      (comp.unix.programmer)
    • pipe implementation on solaris
      ... Is there semantics difference between the pipes are implemented on ... I have a program which runs fine on Linux ... however some times on solaris I get some unpredictable results. ...
      (comp.unix.programmer)