Apr 2, 2013 at 8:12pm UTC
I am trying to work out how to execute the system function and keep the results in a string without writing it to a temp file. Can anyone please help? Every example I have googled uses one??
(Also, what happens if the function I run requires admin rights to execute?)
Apr 2, 2013 at 8:27pm UTC
the correct way is not use system
Apr 2, 2013 at 8:30pm UTC
ok. what should i use? popen()?
Apr 2, 2013 at 8:38pm UTC
non specific. arch/ubuntu to start with.
Apr 2, 2013 at 8:39pm UTC
then there i think you can do something with ncurses but im not sure
Apr 2, 2013 at 8:50pm UTC
looks interesting but is there a way without using curses? i would have assumed there was something in the standard libraries.
Apr 2, 2013 at 8:52pm UTC
no just system which is evil to begin with, but you cant really redirect output back into the program
Apr 2, 2013 at 8:54pm UTC
many reasons. one) its really resource heavy
two) you dont know if the program your trying to run is the right one
three) its os dependent
Apr 2, 2013 at 8:59pm UTC
Thanks. I actually just found this and read it. Very informative!
The thing is, I am making something which is reliant on running third party tools.
I want to create a program with menus which can execute commands against virtualbox on a headless server. I know I could use the php client but I wanted to include some functions which aren't available using the GUI.
Last edited on
Apr 2, 2013 at 9:02pm UTC
Apr 2, 2013 at 9:08pm UTC
ive never needed to use third party applications so i didnt even know about it until you mentioned it so idk if thats any good but you probably did research. i just know that system is horrible