B
Billy Patton
I'm not student, looking for homework help.
I'm looking for a c function that will execute a system function then
return the output into a string. I don't want to use a file as a medium.
pipe to file , read file and return conntents. I would rather avoid the
file IO.
char* dump;
dump = ex_system("/bin/ls /home/me");
char* ex_system(char* ex)
{
char buf[very_big];
//setup some pipes and fork
//to capture stdout/stderr in buf
exec($ex);
return buf;
}
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455, (e-mail address removed)
I'm looking for a c function that will execute a system function then
return the output into a string. I don't want to use a file as a medium.
pipe to file , read file and return conntents. I would rather avoid the
file IO.
char* dump;
dump = ex_system("/bin/ls /home/me");
char* ex_system(char* ex)
{
char buf[very_big];
//setup some pipes and fork
//to capture stdout/stderr in buf
exec($ex);
return buf;
}
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455, (e-mail address removed)