Linux. How to get grand child pid ?
Добавлено: 17 фев 2012, 13:16
my program start process "gnome-open file1.pdf". as result pdfviewer opens file1.pdf on desktop.
I need from my program to know when pdfviewer will be closed.
Any ideas how to do that ?
no, I can't start pdfviewer directly (not at this point at least)
Crazy idea - enumerate all processes in system to get all that have file1.pdf and ppid = 1. Start gnome-open and wait while it exit. enumerate all processes again with same condition (has file1.pdf in command line and ppid = 1). Exclude pids from first run. Hopefully it will be only one.
what do you think ?
I need from my program to know when pdfviewer will be closed.
Any ideas how to do that ?
no, I can't start pdfviewer directly (not at this point at least)
Crazy idea - enumerate all processes in system to get all that have file1.pdf and ppid = 1. Start gnome-open and wait while it exit. enumerate all processes again with same condition (has file1.pdf in command line and ppid = 1). Exclude pids from first run. Hopefully it will be only one.
what do you think ?