Copyfunction (original_file_name, copy_file_name);
Do you know if there is something or I have to create a function to do it?
Greetings and thank you
Francisco
Explore... Chat... Share...
void CopiaPega(String FileOriginal, String FileCopia)
{
char ibuffer[64]; //declare a buffer
Serial.println("In copy"); //debug
if (LittleFS.exists(FileCopia) == true) //remove file copy
{
LittleFS.remove(FileCopia);
}
File f1 = LittleFS.open(FileOriginal, "r"); //open source file to read
if (!f1)
{
Serial.println("error 1"); //debug
}
File f2 = LittleFS.open(FileCopia, "w"); //open destination file to write
if (!f2)
{
Serial.println("errror 2"); //debug
}
while (f1.available() > 0)
{
byte i = f1.readBytes(ibuffer, 64); // i = number of bytes placed in buffer from file f1
f2.write(ibuffer, i); // write i bytes from buffer to file f2
}
f2.close(); // done, close the destination file
f1.close(); // done, close the source file
Serial.println("End copy"); //debug
}
You need to provide some information about the rel[…]
The difference could be down to the capacitor that[…]
Otherwise: - check the voltage in real life, if th[…]
As the title describes, I am not getting the expec[…]
GPIO16 is different to the other GPIO pins. It do[…]
Hello all, I am completey noob and after ages rea[…]
Well, that's embarrassing for me, but thanks! We[…]
Also... This is the ESP8266 Arduino forum: you[…]
You are trying to connect to a secure server and I[…]
I use a NodeMCU and I can update a normal sketch o[…]
Well, seems I need to do this myself. Attached is […]
Follow US on Twitter and get ESP8266 news and updates first.