Re: g_spawn_asnyc -- What is wrong ?



--- me ok <mjaz_the_mighty2 yahoo com> wrote:
harringf wrote:
Hello all,

I am trying to use g_spawn_async, but so far I am not getting the results I
expect.

 In the program below: 
 1) The output from the func() is never displayed.
 2) The file hello.txt is never removed.
 3) I get the child's pid correctly (i.e, not 0 or -1)
 4) The program does not report errors.


  I am sure I am doing something really wrong -- where ?

 Note: I am trying to do this so that I can delete a directory recursively
in
windoze and Linux, so I am trying to stay platform independent by using this
-
Any better alternatives ?

  Thanks in advance.

rm Requires You To Respond To a Yes/No Question "rm: remove `FILENAME`?
And I Didn't See In Your Program Your Answer To That Question.
You Can Use
char* cmd[] = { "rm", "-f", "hello.txt", NULL };
To -force The Removal Of The File(s).
Also You Don't Want To Put Quotes Around The NULL In The cmd Array.

The Func() Problem I'm Not Sure About But Fixing Those Things Might Fix That
One Too.

I Hope This Helps You.
Mjaz


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


 Mjaz,

 Thanks for the reply -- rm only asks for a confirmation when used with the -i
flag ( rm -i ). In this case, it is not being used, and it is not an alias to
one that uses. That would be a good catch though!.

  The problem is when passing a child fuction pointer as argument to g_spawn.
If that argument is NULL, it works OK.

  Again, thanks for the help.

Harring.


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]