Waiting for end of GeExecuteProgram?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/12/2007 at 04:29, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.111 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hi there!
    I've run into a fun little problem: My exporter creates intermediary files that are then converted by an external program into the final output format. I would like to implement a convenience function that clears up all the litter created (the intermediary files could be deleted). However, I don't know whether the external program has finished yet or not, because GeExecuteProgram(...) returns immediately and seemingly runs the program in its own thread. Is there a way to wait for the end of the execution of an external program, i.e. run it in the current thread? That way I could create my own Thread class to call the external converter and delete the intermediary files afterwards.
    Although I'm currently investigating whether I could skip the external converter altogether that might not be possible in a simple manner, so it would be great if I could implement the above convenience function while I'm trying to remove the external program completely.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/12/2007 at 09:56, xxxxxxxx wrote:

    I suspect that this is not possible unless you include OS-level support (libs or dlls). One possible not-very-great solution might be to have the executable create an 'i'm done' file which you test for with GeFExist(). When that file exists, the executable is done and your plugin can then delete it with GeFKill().



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/12/2007 at 13:47, xxxxxxxx wrote:

    too bad. But perhaps you're right. Anyway, your workaround sounds a lot more feasible than my "just leave them there" option. So, thx for that idea. :)


Log in to reply