I've written a daemon that writes the word "Beat" to a file, followed up the current date and time at 15 second intervals. However, each time I check the output file, the daemon appears to be outputting twice like this:
Beat: Fri Jan 1 18:09:01 2010
Beat: Fri Jan 1 18:09:01 2010
where it should only have on entry. the entire code is located at http://pastebin.com/m27a81981 (I didn't want to paste it here as the entire thing is a bit long.). The function for writing to the file is
get_time();
ofstream outputFile("heart.txt", ios::app);
beat = "\nBeat: " + gtime + "\n";
outputFile << beat;
outputFile.close();
Thanks in advance.