|
|
#1 |
|
Alternative to the /proc
I know that "proc" absent in OS X, but can you show an alternative?
Examples: strings /proc/PID/environ -will show us variable environments of process. file /proc/PID/cwd -will show us working catalog of process. stat -c %z /proc/PID -will show us when the process is started. cat /proc/PID/status -will show us who is the owner of this process and more. Possibly in OS X too there is such place where it is possible to learn a lot of things about process? |
|
|
|
0
|
|
|
#2 |
|
Try Activity Monitor. Usually the first opened object is its currently working directory.
Programmatically, I have no clue. Sorry |
|
|
|
0
|
|
|
#3 |
|
man ps
|
|
|
|
0
|
|
|
#4 |
|
Using what language?
The posted examples are shell commands. So do you need shell commands? If so, then the 'man ps' suggestion is a good one. Also see 'man top'. The sysctl(3) C function is a way to get varied process info using C: http://developer.apple.com/library/M.../sysctl.3.html See the KERN_PROC selector, and also find the search term "kproc" on the man page for an example. You'll need to know the struct def, so refer to the appropriate .h file. Finally, the source for the commands 'ps' and 'top' is available from the Darwin project: http://www.opensource.apple.com/ Both programs run setuid-root, so you will need enhanced privileges to obtain some process info. There's an API for that. |
|
|
|
0
|
|
|
#5 |
|
Thanks for answers.
With the 'ps' and 'top' I will only decide this tasks (already decided): "file /proc/PID/cwd -will show us working catalog of process. stat -c %z /proc/PID -will show us when the process is started. cat /proc/PID/status -will show us who is the owner of this process" chown33, with shell commands. "strings /proc/PID/environ -will show us variable environments of process." -I think that in OS X there is no such. |
|
|
|
0
|
|
|
#6 |
|
atMonitor does display that info, so there is a way.
Last edited by Madd the Sane; Jan 27, 2013 at 03:51 PM. Reason: It is called atMonitor |
|
|
|
0
|
|
|
#7 | |
|
Quote:
-E Display the environment as well. This does not reflect changes in the environment after process launch.At the Terminal window, 'ps' is aware of the window width (see its man page). So either use the -w option (repeated, per its man page), or try this: Code:
ps -E | cat |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 03:02 PM.







Linear Mode
