[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]
I believe you can do this using the popen() function. There's an example of how to do so here: http://ubuntuforums.org/showpost.php?p=5507024&postcount=12 Regards, Ross Bearman On Sat, Sep 6, 2008 at 7:35 PM, Sam Grabham <sam@xxxxxxxxxxxxxxxxx> wrote: > Hi > > Tinkering with C++ again. > > How should i capture OS system values like "netstat" and "traceroute" info > etc, and use them within C++. > > Should i be using a C++ header that would allow to extract data from the OS? > > I have been using a SYSTEM(netstat -anopt | grep :21 >> temp.txt) then > reading the data in via a loop, I would like to be able to pipe data into a > variable so i can extract in memory and speed things up. I would like to be > able to use basic bash commands to extract values i want. > > Regards > > Sam > > > -- > The Mailing List for the Devon & Cornwall LUG > http://mailman.dclug.org.uk/listinfo/list > FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html > -- The Mailing List for the Devon & Cornwall LUG http://mailman.dclug.org.uk/listinfo/list FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html