(sorry for my English) I'm trying to create a simple console application. I have qtqreator + Ubuntu, I'm making a pipe, read some information in the pipe from the file, and my "thorn" -processation has to be clarified so my code is:
namespace Using std; Main (int argc, char ** argv) {int fildes [2]; Four f; File * FP; Int State; Fildes; Cout & lt; & Lt; Argv [1] & lt; & Lt; "" & Lt; & Lt; Argv [2] & lt; & Lt; Endl; Fp = fopen (argv [1], "r"); If (fork!) {Execl (argv [2], argv [2], and field [0], NULL); Retribution ("execl () failure! \ N"); } And {while (! FIF (FP)) {ch = fgetc (fp); Write (fildes [1], & amp; ch, 1); } Fclose (fpose); Wait (& state); Close (fildes [0]); Close (fildes [1]); }}
The main problem is in the execl ()
function: Exec format error I have tried different ways to write my own path, but some Does not work (please, help me! Thanks)
Comments
Post a Comment