I want to check the process full path(if exist), if the path is in a specified folder like /Applications/, then I will do some work related it.
Some processes are created as the result of executing binaries. Others are not. The path you've highlighted here is not always correct even if the process was created as a result of executing a binary, and the path is only valid in the context of the process that caused it to be executed.
What do you plan to do with the path string in a kext? Operations using path names are generally strongly discouraged from kernel context.
= Mike
On Jan 12, 2011, at 12:24 AM, searockcliff wrote:
I want to get the directory location of the process file.
For example, in user space, the TextEdit, the pid is 234
localhost:~ macuser$ ps -p 234
PID TTY TIME CMD
234 ?? 0:00.19 /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_94231
I want to get this "/Applications/TextEdit.app/Contents/MacOS/TextEdit" in kext.
At 2011-01-12 15:54:33,"Michael Smith" <
email@hidden> wrote:
On Jan 11, 2011, at 6:15 PM, searockcliff wrote:
Hello,
I have a process ID, I need to get the full path of the process in kext.
I know there are methods in user space application, like sysctl.
Are there also functions to achieve this in kext?
Processes don't have paths.
What are you trying to do?
= Mike
--
Excellence in any department can be attained only by the labor of a lifetime; it is not to be purchased at a lesser price -- Samuel Johnson
--
Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile -- Hippocrates