[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KRun and getting sub process id
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2008-07-29 1:31:11
Message-ID: 200807282131.21581.mpyne () purinchu ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/alternative)]


On Monday 28 July 2008, Ramazan Girgin wrote:
> Hi all,
>     I want to open a file and wait it was closed. I found a solution for
> this with KRun. I am using KRun::run() method. That method opens file and
> gives me started sub process id . With PtyProcess class with checkPid()
> method i check if process is still running.
>    This method is working for text files which opened with krite. But for
> open office documents KRun::run() method returns different(wrong) process
> id which is not equal started openoffice process id. On my machine it is 19
> difference between real pid and KRun::run() returns.( like KRun returns
> 1900 but real process id is 1919)
>    How can i know real sub process id ?


What's probably happening is that the OpenOffice documents are associated with 
a wrapper program that gets executed.  The wrapper then opens up the right 
oowriter or whatever (which now has a different PID) and eventually opens up 
the file.


I'm not sure that this is the case here but it's a possibility I think 
(especially since you mentioned it's always 19 off between the PIDs).


As far as figuring out the "real" executable PID, I'm not sure how to do it in 
this case.


Regards,
 - Michael Pyne

[Attachment #7 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Consolas'; font-size:11pt; \
font-weight:400; font-style:normal;">On Monday 28 July 2008, Ramazan Girgin \
wrote:<br> &gt; Hi all,<br>
&gt;     I want to open a file and wait it was closed. I found a solution for<br>
&gt; this with KRun. I am using KRun::run() method. That method opens file and<br>
&gt; gives me started sub process id . With PtyProcess class with checkPid()<br>
&gt; method i check if process is still running.<br>
&gt;    This method is working for text files which opened with krite. But for<br>
&gt; open office documents KRun::run() method returns different(wrong) process<br>
&gt; id which is not equal started openoffice process id. On my machine it is 19<br>
&gt; difference between real pid and KRun::run() returns.( like KRun returns<br>
&gt; 1900 but real process id is 1919)<br>
&gt;    How can i know real sub process id ?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"></p>What's probably happening is that the OpenOffice documents are \
associated with a wrapper program that gets executed.  The wrapper then opens up the \
right oowriter or whatever (which now has a different PID) and eventually opens up \
the file.<br> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"></p>I'm not sure that this is the case here but it's a possibility \
I think (especially since you mentioned it's always 19 off between the PIDs).<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></p>As far \
as figuring out the "real" executable PID, I'm not sure how to do it in this \
case.<br> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
                -qt-user-state:0;"></p>Regards,<br>
 - Michael Pyne</p></body></html>


["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic