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
This way of solving the problem seems to be the best when the goal is to retrieve the PID of a given program. As the /proc directory is tidy coupled to the kernel it's probably the fastest
This is what I gonna implement for the second part of my development.

Antonio.


-Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to