X
82 Rate this article:
No rating

How to get the an IDL session's own process ID (PID)?

Anonym

Here are approaches for getting an IDL session's own process ID or PID.

WINDOWS

Issue the following IDL CALL_EXTERNAL command to call into Windows kernel32.dll.

ProcessID = StrTrim(Call_External('kernel32.dll', 'GetCurrentProcessId'), 2)

Print, ProcessID

LINUX and MAC

Issue the following IDL commands to get the IDL session's process ID.

Spawn, 'cat', PID=pid, UNIT=unit, /NOSHELL

Spawn, 'ps -o ppid= ' + StrTrim(pid,1), ProcessID

Free_Lun, unit

Print, ProcessID

 

Written by JU & approved by BC (24 Oct 2018)