Page 1 of 1

copy data from one partition to another one

Posted: Tue Dec 14, 2021 8:53 pm
by HyperUniverse
Hi,

How do I copy data from one fat partition to another fat partition in esp idf?

Thank you,
Regards,

Re: copy data from one partition to another one

Posted: Wed Dec 15, 2021 1:39 am
by ESP_Sprite
I don't think there's a function for that, but you can do it manually. Pseudo-code:

Code: Select all

f1=fopen(src, "r");
f2=fopen(dst,"w");
while(!feof(f1)) {
  char buf[BUFLEN];
  int rlen=fread(buf, 1, BUFLEN, f1);
  fwrite(buf, 1, rlen, f2); 
}
fclose(f1);
fclose(f2);