[Lazarus] Process ID

Antonio Fortuny a.fortuny at sitasoftware.lu
Thu Sep 13 10:48:00 CEST 2012


> 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 at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>




More information about the Lazarus mailing list