Hello I am trying to write a program where I feed the C stdlib a bash system call that prints the output to a file. Currently, system() will only print to console and won't be redirected to the file.
string read_command = "dd if=" + io_filesystem + "/" + filename + " of=" + output_directory + "/" +
"tmp.tmp bs=" + bs_string + " count=1";
string write_command = "dd if=" + output_directory + "/" + "tmp.tmp of=" +
io_filesystem + "/" + "tmp.tmp bs=" + bs_string + " count=1";
string system_read_command = "echo $(" + read_command + ") >>" + output_directory + "/out.log";
status = system(system_read_command.c_str());
string system_write_command = "echo $(" + write_command + ") >>" + output_directory + "/out.log";
status = system(system_write_command.c_str());
I would like the output of the second command to be appended to the end of the file without overwriting the first command output.