Re: [beagleboard] running BASH commands from C++

2013-12-21 Thread Bas Laarhoven
On 21-12-2013 17:04, Dhanushka Jayaweera wrote: hey guys, I want to add this bash command to my c++ program. *echo cape-bone-iio /sys/devices/bone_capemgr.*/slots* i tried this *#includecstdio* *#includecstdlib* *#includeunistd.h* *using namespace std;* *int main() {* * system(echo

Re: [beagleboard] running BASH commands from C++

2013-12-21 Thread Dhanushka Jayaweera
both commands work in the terminal On Saturday, December 21, 2013 9:52:27 PM UTC+5:30, Dhanushka Jayaweera wrote: well i tried this *system(echo cape-bone-iio /sys/devices/bone_capemgr.9/slots);* still the same On Saturday, December 21, 2013 9:40:04 PM UTC+5:30, Bas Laarhoven wrote:

Re: [beagleboard] running BASH commands from C++

2013-12-21 Thread Bas Laarhoven
On 21-12-2013 17:24, Dhanushka Jayaweera wrote: both commands work in the terminal So you know what to do, now find out how to do it :-) What is the result from the system() call? -- Bas BTW: You can also try writing the proper text directly to the slots file! On Saturday, December 21,

Re: [beagleboard] running BASH commands from C++

2013-12-21 Thread Dhanushka Jayaweera
im getting nothing.. no errors. but it wont write the file either :( im pretty new to BBB, its just my 5th day of using it... and I did some googling, couldn't find a solution yet.. im using *echo cape-bone-iio /sys/devices/bone_capemgr.9/slots *to create the file for ADC. right now i have

Re: [beagleboard] running BASH commands from C++

2013-12-21 Thread David Lambert
Have you tried looking at the return status of the system call. That may give a clue. Also it may be worth explicitly giving the path for echo: int status; status = *system(/bin/echo cape-bone-iio /sys/devices/bone_capemgr.9/slots); *printf(status = %d\n, status); HTH, Dave. On