Re: Unix Process ID (and Processes List)
Re: Unix Process ID (and Processes List)
- Subject: Re: Unix Process ID (and Processes List)
- From: Aram Greenman <email@hidden>
- Date: Tue, 4 Mar 2003 16:22:17 -0800
On Tuesday, March 4, 2003, at 02:21 PM, Daniele M. wrote:
Hi
I would to know the Unix ID number of a process. I have found the code
to get the processes list. Is there a method to get, from here, the
unix pid of the process?
Check out my AGProcess class at
http://sourceforge.net/projects/agkit.
For example, to loop through every running process and log its pid and
command:
NSEnumerator *en = [[AGProcess allProcesses] objectEnumerator];
AGProcess *p;
while (p = [en nextObject])
NSLog(@"%d %@", [p processIdentifier], [p command]);
To find the pid of a specific process:
int pbx = [[AGProcess processForCommand:@"Project Builder"]
processIdentifier];
Aram
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.