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
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]