FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Storing system calls in C





Liu
Is there any way to store the output of system calls in C?

I.e. piping the output of the Unix command system("ls") into a string which will be used later in the program.

The only method I can think of right now is system("ls>temp"), read contents of temp, system("rm temp -f"). If you have better suggestions, please give me some.

Gratitude for help.
Liu
I just discovered the answer a couple days ago, a friend told me a way to do it, for those interested in the answer you can use popen.
Related topics
Problam about google ad code
Creating a new Operating System
installer un cms avec fantastico
Installing, Partitioning & Formatting HDDs
Emulator - A Hardware Based Learning Model
what linux games do you play?
science vs. religion
Do you have a browser for linux that interprets html like IE
Download database.
What Are Viruses
COnstructing an OS from nothing...
file lost -- help
sldkfj
Custom Operating System in C#, C++, or Java
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.