how to monitor a process

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LeandroDreamer

hello, on the doc, on https://docs.godotengine.org/en/stable/classes/class_os.html?#class-os-method-execute , says that you can use the pid to monitor the process, my question is, monitor what and how?

is there a way to get, idk, memory use of those procces or if they exist? because i didnt found it

im trying to use ffmpeg but it would be super uderful to know when the process ends to kill it and delete the temp files

:bust_in_silhouette: Reply From: felaugmar

kill is the only operation available to work directly with PIDs for now.

So the option would be to use the execute method with commands like tasklist (Windows) or ps (Unix) to query if the pid is available or if more control is needed, create utility scripts in other programming language and call it with execute.