You are not logged in.
#include <unistd.h>
main() {
execlp("bash", "bash", "7z", ">", "7z.tmp", NULL);
}
just gives me "incorrect command line". Any ideas?
Pretty hard to google/search for this, I didn't get any usable results, so trying my luck here.
Last edited by Jindur (2012-05-19 11:23:12)
Offline
try ("bash", "bash", "-c", "7z > 7z.tmp", NULL);
Though executing subshell is not recommended in C, make sure you don't allow user input in.
Or if you do, single quote them and strip additional single quotes.
Last edited by Cloudef (2012-05-19 10:57:29)
Offline
Thanks, that fixed it.
Offline
You should replace the subshell invocation with proper piping so that you don't need temporary files anymore.
Offline
Usually piping into your program usually involves the input or the contents of a file, as if it were being typed in and being processed much the same.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline