Help on g_spwan_async



 
Folks,

 I have the following code:

    exe_string = g_strdup_printf("%s %s", rm_cmd, path);
    g_print("Executing command: %s\n", exe_string);
    if ( g_shell_parse_argv(exe_string ,&i, &exe_cmd , &error) != TRUE) {
        *err = g_strdup(error->message);
        g_error_free(error);
        return FALSE;
    }
    ret_val = g_spawn_async_with_pipes(NULL, exe_cmd ,NULL,
            G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_SEARCH_PATH,
            NULL, NULL, &pid, NULL, NULL, NULL, &error);

  rm_cmd = "deltree /Y" and path= "I:\somepath\somedir"

 When I run the command on windowze, I can see the DOS console windows poping
up and desapearing; however, the directory never gets deleted.

  IF I do an exact copy andpaty of the command that I output with g_print
above, the directory gets deleted.

  What am I doing wrong here ? 


NOTE: I am using this code because I need to delete anentire directory
structure on Windows and the remove() calls is only working for files -- I
guess it has a bug reported on the remove(3) man pages.
If anyone has a better suggestion that the code above, please drop me a line.


Note 2: compiled with mingwin gcc 2.95.3 (Windows binary from Tor's site.)



Thanks for any help.

Harring.

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com



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