At a certain point in my c code I want to run a program in the same directory. Then immediately return control back to code. What command and paramaters do I need to use? Thanks.
-Carl
At a certain point in my c code I want to run a program in the same directory. Then immediately return control back to code. What command and paramaters do I need to use? Thanks.
-Carl
Do you mean that you want to run the application in the background?
If so, just compile the code normally, and add "&" to the back of the command, e.g.:
That will run myprog as a background task, and as long as myprog doesn't require input from the stdin stream, that should be fine.Code:$ myprog &
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
In my c code how do I force another program in the same directory as my code to run before I continue. I need another file to update (which executing the program does) so the data my current code will work on is up to date. I hope that makes sense. Thanks.
-Carl
Generally, I would use a shell-script, something where you just "list" the commands you need to execute, e.g.
It's much more easy (and easier to change later) to use a shell-script than to write C code to do the same work.Code:#!/bin/sh # This is a "magic" for "This is a shell-script". prog1 # first program to run prog2 # second program to run.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Thanks for your help!