I'm trying to modify an arduino sketch written in C++ on an Intel Galileo board. The board has an SD card on board.
In the loop, a string called 'data' is created.
Would somebody be able to demonstrate how after this I can create a text file, write the string to the file and save and close it to the directory /home/data?
The idea is that a new file will be created containing each string of data.
Was your sketch really written in C++ on an intel Galileo board ? Or for an intel Galileo board ?
My best advice would be to install the regular Arduino IDE, if you don't already have it, and look closely at the basic examples which include writing to files on an SD card.
They follow what is the basic scheme for writing to a file using C++ on any computer environment.
name the file
open or create the file
write to the file
close the file
Then, consider each of those steps, and modify whatever needs to be modified to meet the differences of the galileo board.