copy data from one partition to another one

HyperUniverse
Posts: 33
Joined: Fri Oct 29, 2021 11:20 pm

copy data from one partition to another one

Postby HyperUniverse » Tue Dec 14, 2021 8:53 pm

Hi,

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

Thank you,
Regards,

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: copy data from one partition to another one

Postby ESP_Sprite » Wed Dec 15, 2021 1:39 am

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);

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 69 guests