Hi guys, first of all I can only provide a snippet as my sketch is huge, it wont fit in a post and I dont expect anyone to go wading through it.
I am having problems with one small piece. I am combining two strings using sprintf with a couple of slashes and a .txt on the end to use as a file path to write to SD. It works perfectly, the only problem is if nothing is stored in my char arrays then I end up writing a file called //.txt.
To try and get around this I have placed my function call inside an if statement that should only be true if the file path is not equal to //.txt.
It does not wat to work, could anyone tell me what is going wrong here?
case LOG_SAVE_BTN:
snprintf(logPath, MAX_STR, "/%s/%s.txt", logFolder, logName);
Serial.println (logPath);
if (logPath != "//.txt") {
saveLogFile(SD, logPath);
}
break;
Thanks in advance ![]()