   return ret;
 }
 
-static FatFile writeFile;
+static SdFile writeFile;
 
 static void appendData(const String& data) {
-  if (writeFile.write(data.c_str(), data.length()) == (int)data.length())
+  if (writeFile.write(data.c_str(), data.length()) == data.length())
     Serial.println("AP:OK");
   else
     Serial.println("AP:NAK");


static void emitList(const String& path)
{
  FatFile dir;
  if (!dir.open(&sd, path.c_str(), O_READ)) {
    Serial.println(F("E:Failed to open requested directory"));
    return;
  }
  dir.rewind();
  FatFile listFile;
  while (listFile.openNext(&dir)) {
    char name[256];
    listFile.getName(name, sizeof(name));

  if (doLoop)
    runEEPROM();
}
