I am calling a command via system(command) call. But no other code is executed after this system() call.
Why is so? I thought, system() would create a child process for "command" execution and my program (parent of "command"-child) will continue executing code after that.
Am I not understanding system() correctly?
code:
printf("before
");
system("tail -f filename"); /* long lived - never returns */
printf("after
");
Here, I do not see after getting printed ever.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…