spawning a command like this: zip -z foo < foowhat with...

View: New views
8 Messages — Rating Filter:   Alert me  

spawning a command like this: zip -z foo < foowhat with...

by Giuseppe Torelli-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I apologize for asking a gtk related question into xfce4 ml.
I need to spawn the program in the object with g_spawn_async_with_pipes
or other kind of. The problem is that I don't get any error message but
the command is simply not executed. Is it possible to use the < redirector
with glib?

Thank you,
--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by David Mohr-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 22, 2008 at 3:30 PM, Giuseppe Torelli <colossus73@...> wrote:
> Hi,
>
> I apologize for asking a gtk related question into xfce4 ml.
> I need to spawn the program in the object with g_spawn_async_with_pipes
> or other kind of. The problem is that I don't get any error message but
> the command is simply not executed. Is it possible to use the < redirector
> with glib?

I'm pretty sure that that won't work, because redirection is a shell feature.

~David

> Thank you,
> --
> Colossus
> Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev@...
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by Daniel Morales-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maybe you can use g_spawn_command_line_sync to execute that command

//danielm

David Mohr escribió:

> On Tue, Jul 22, 2008 at 3:30 PM, Giuseppe Torelli <colossus73@...> wrote:
>  
>> Hi,
>>
>> I apologize for asking a gtk related question into xfce4 ml.
>> I need to spawn the program in the object with g_spawn_async_with_pipes
>> or other kind of. The problem is that I don't get any error message but
>> the command is simply not executed. Is it possible to use the < redirector
>> with glib?
>>    
>
> I'm pretty sure that that won't work, because redirection is a shell feature.
>
> ~David
>
>  
>> Thank you,
>> --
>> Colossus
>> Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
>> _______________________________________________
>> Xfce4-dev mailing list
>> Xfce4-dev@...
>> http://foo-projects.org/mailman/listinfo/xfce4-dev
>>
>>    
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev@...
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>
>  



_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

signature.asc (260 bytes) Download Attachment

Re: spawning a command like this: zip -z foo < foowhat with...

by Giuseppe Torelli-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 22, 2008 at 11:42 PM, Daniel Morales <daniel@...> wrote:
> Maybe you can use g_spawn_command_line_sync to execute that command

Unfortunately it doesn't work. Any other idea?
--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by Biju Chacko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Giuseppe Torelli wrote:
> Hi,
>
> I apologize for asking a gtk related question into xfce4 ml.
> I need to spawn the program in the object with g_spawn_async_with_pipes
> or other kind of. The problem is that I don't get any error message but
> the command is simply not executed. Is it possible to use the < redirector
> with glib?
>  

This is probably what you want:

http://www.opengroup.org/onlinepubs/007908799/xsh/popen.html


-- b

_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by Mike Massonnet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 09:39:23AM +0200, Giuseppe Torelli wrote:
> On Tue, Jul 22, 2008 at 11:42 PM, Daniel Morales <daniel@...> wrote:
> > Maybe you can use g_spawn_command_line_sync to execute that command
>
> Unfortunately it doesn't work. Any other idea?

I come here a bit in a hurry, so I just throw my random guess: fork
before running the command.  I think this should do it.

> --
> Colossus
> Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org

Cheers
--
Mike
mmassonnet@...
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by Stephan Arts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 10:37 AM, Mike Massonnet <mmassonnet@...> wrote:
> On Wed, Jul 23, 2008 at 09:39:23AM +0200, Giuseppe Torelli wrote:
>> On Tue, Jul 22, 2008 at 11:42 PM, Daniel Morales <daniel@...> wrote:
>> > Maybe you can use g_spawn_command_line_sync to execute that command
>>
>> Unfortunately it doesn't work. Any other idea?
>
> I come here a bit in a hurry, so I just throw my random guess: fork
> before running the command.  I think this should do it.

Sort of...

use: g_spawn_async_with_pipes (zip -z foo)

and write foowhat to the input_pipe...

Then it works.

Cheers,
Stephan
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev

Re: spawning a command like this: zip -z foo < foowhat with...

by Giuseppe Torelli-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 10:21 AM, Biju Chacko <botsie@...> wrote:
> This is probably what you want:
>
> http://www.opengroup.org/onlinepubs/007908799/xsh/popen.html

Thank you ALL for your kind answers.
--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
_______________________________________________
Xfce4-dev mailing list
Xfce4-dev@...
http://foo-projects.org/mailman/listinfo/xfce4-dev
LightInTheBox - Buy quality products at wholesale price