void fileStore() //If 7th day of week, rename "log.txt" to ("log" + month + day + ".txt") and create new, empty "log.txt"
{
// create a file and write one line to the file
getDateTime();
File log = SPIFFS.open("LOG.TXT", "a");
if (!log)
{
Serial.println("file open failed");
}
// rename the file "LOG.TXT"
logname = "";
logname = "LOG";
logname += Clock.getMonth(Century);
logname += Clock.getDate();
logname += ".TXT";
Serial.println("Gets Here 2");
//For troubleshooting
//Serial.println(logname.c_str());
log.close();
// create a new "log.txt" file for appended writing
log = SPIFFS.open("LOG.TXT", "a");
if (!log)
{
Serial.println("file open failed");
}
log.println("");
log.close();
Serial.println("");
Serial.println("New LOG.TXT created");
}
Putting Serial.println into function; function is completing without renaming the file.
William