Feeling a little stupid - maybe some kind soul can help out.
I'm trying to spawn an external process like 'tar' from a Motif GUI whilst getting ongoing updates from the spawned process.
Messing around with sgitcl has got me some ok-ish results. However, the tclMotif UI locks-up as it waits for the external command to complete. To feel somewhat less stupid, I've spent some time refreshing my memory about pipe/fork/exec/waitpid and have been successful in launching processes from a toy CLI C programme.
A million years ago when I wrote my 'cdrecord' Motif front-end thing, I moved the whole traditional pipe/fork/exec malarkey into a class and 'hoped for the best'. It worked, but of course suffered from the same UI locking-up issues, which I camouflaged by posting a modal progress dialog for the duration of the burn. This time around I'm trying to understand how to use VkSubProcess() and hopefully gain some more flexibility and a better understanding of things. Together with VkPipe and VkInput, VkSubProcess should make the pain go away by raising VkCallback events when stuff happens on the relevant file descriptors. Unfortunately, there's no available example code and I'm having a hard time understanding how to code things just by reading the man page for VkSubProcess.
I tried the following:
Code: Select all
VkSubProcess *p = new VkSubProcess();
p->create("ls", TRUE, FALSE);
But that gives me compilation errors and a headache after trying various permutations
So, before I waste weeks banging my head on this and then giving up, I figured I'd ask for directions instead. A bit of code that spawns something through VkSubProcess would be ideal, I'll try and figure out the rest from there.