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
- Previous message: jpd: "Re: sort does not seem to work "correctly""
- In reply to: clusardi2k_at_aol.com: "What Is Better than ps (want program name etc)"
- Next in thread: Bill Marcum: "Re: What Is Better than ps (want program name etc)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 .
- Previous message: jpd: "Re: sort does not seem to work "correctly""
- In reply to: clusardi2k_at_aol.com: "What Is Better than ps (want program name etc)"
- Next in thread: Bill Marcum: "Re: What Is Better than ps (want program name etc)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|