LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   running another application(exe) on another terminal through c program (https://www.linuxquestions.org/questions/programming-9/running-another-application-exe-on-another-terminal-through-c-program-4175416911/)

saidopdf 07-16-2012 12:51 AM

running another application(exe) on another terminal through c program
 
Hi everyone,

I want to run a c program ,that executes another application on another terminal.
ex.on executing a.out in one terminal(pts/1),calls executes another application in another terminal(pts/2).

thanks and regards
sai

pan64 07-16-2012 01:00 AM

every process has a parent process and it cannot be changed (just parent can be terminated). So the terminal emulator window where you want to start your app will be the parent (or parent of parent of ...) of your app. From the other hand you can (re)open stdin, stdout to use any (other) terminal - if you have sufficient access permissions.

saidopdf 07-16-2012 01:07 AM

what i am able to do is ,i am able to send data to the another terminal(using open call of file descriptor) , but my question is is it possible execute some .exe there it self.


Thanks and regards,
sai

pan64 07-16-2012 01:14 AM

no, you cannot modify the parent-child chain, so the process started in terminal pts/1 will be the child of that terminal process and any app started in pts/2 will be the child of that terminal. With other words: any app has exactly one parent which started it and it cannot be changed. You can ask a process to start a child (if it was capable to do that), but you cannot start a process and "attach" it to another parent.

saidopdf 07-16-2012 01:18 AM

Quote:

Originally Posted by pan64 (Post 4729197)
no, you cannot modify the parent-child chain, so the process started in terminal pts/1 will be the child of that terminal process and any app started in pts/2 will be the child of that terminal. With other words: any app has exactly one parent which started it and it cannot be changed. You can ask a process to start a child (if it was capable to do that), but you cannot start a process and "attach" it to another parent.

so what you are saying is i can display the data on another terminal ,but cannot execute .exe in that terminal.

NevemTeve 07-16-2012 01:20 AM

check the source of 'openvt' and 'chvt' they might help

bigearsbilly 07-16-2012 02:04 AM

What do you mean "another terminal"?

A terminal is just a pseudo output device, X terminal, console, a tty, a screen.
The question doesn't make sense as stated.


All times are GMT -5. The time now is 04:38 AM.