Hi, I've been messing around with Asset OTA, and can't figure out how to clear out old assets.
I used the example firmware, but dragged files in and out on various compiles just to test. The old files are not showing up at all in console, but ARE still showing up as "found assets" in the print out from the checkAssets() function. How do I get rid of the old files?
I tried disconnecting the power, EEPROM.clear(); in the setup, and fsync(fd); after the open and none worked so I'm out of ideas. Any thoughts?
checkAssets() function in the example code stores a copy of the assets in the assetsDir. I would change the code to be something like this:
// This is just for demonstration purposes for reading assets
DIR *dirp = opendir(assetsDir);
struct dirent *de = readdir(dirp);
if (de->d_type != DT_REG)
// Not a file
String path = String::format("%s/%s", assetsDir, de->d_name);
Once it runs once, it will delete the files from the file system.
Ah unlink! Thank you Rick, that worked perfectly.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.