[Lazarus] Process ID
Kaj Mikkelsen
laz at vgdata.dk
Thu Sep 13 10:17:29 CEST 2012
Michael Schnell wrote:
>IMHO its easier and more straight forward to do the functionality of
"pidof" directly in pascal code:
>- do a loop with a findnext() to handle all directories within "/proc"
>- in each of them test if a file "cmdline" exists
>- read cmdline in a staring
>- if this denotes the process you mean to access the directory name is
the PID
All depending on what was the purpose.
I thought the goal was to find all processes owned by a specific user, but
have now leaned this was not the case.
Using the /proc file system eliminate the need for a call to the underlying
OS which is good.
/Kaj
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
More information about the Lazarus
mailing list