LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   System calls/functions to execute a file within a program (https://www.linuxquestions.org/questions/programming-9/system-calls-functions-to-execute-a-file-within-a-program-550566/)

psandeepnair1985 05-02-2007 01:44 AM

System calls/functions to execute a file within a program
 
Hi,

Is there any system call or library function using which we can execute a file and redirect its output to another file........Can i use execve family of functions for this purpose.If yes how?

bigearsbilly 05-02-2007 02:37 AM

language?

exec will replace the calling process.
Code:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    system("/bin/ls > out.log");

}



All times are GMT -5. The time now is 03:52 AM.