You are not logged in.

#1 2014-12-19 13:07:54

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

How to pass arguments to a external program interactively with gtk

Hi,
I am currently struggling to figure out how to start a external program e.g. pacman from gtk program and interact with it in my application like when it asks for any confirmation, I should be able to reply back to pacman from my application. In case I am not clear please let me know?

Cheers big_smile


Keep Calm, And Enjoy Life smile

Offline

#2 2014-12-19 13:16:57

SahibBommelig
Member
From: Germany
Registered: 2010-05-28
Posts: 80

Re: How to pass arguments to a external program interactively with gtk

You might want to look into the popen(2) call or into GLib's higher level GSubprocess module.
In any case, you want to write on stdin once a confirmation is requested.

Alternatively, if you just want to bypass the confirmation questions of pacman, just use --noconfirm.

Offline

#3 2014-12-19 13:26:03

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Re: How to pass arguments to a external program interactively with gtk

SahibBommelig wrote:

You might want to look into the popen(2) call or into GLib's higher level GSubprocess module.
In any case, you want to write on stdin once a confirmation is requested.

Alternatively, if you just want to bypass the confirmation questions of pacman, just use --noconfirm.

Thanks SahibBommelig for your reply. Could you point me to a tutorial on GSubprocess. I need to both read and write into the buffer asynchronously, which is not possible in popen.

Cheers big_smile

Last edited by Debasish Patra (2014-12-19 21:30:53)


Keep Calm, And Enjoy Life smile

Offline

Board footer

Powered by FluxBB