Open rojer opened 7 years ago
Ah, I did not know that this was the posix way. Will fix in som indefinable future 😉. Thanks for the heads up!
Cheers / P
perhaps the latter (delete if src != dst
and dst
already exists) is simpler to implement.
I don't expect this to be addressed immediately, but perhaps in some future revision...
rename()
is commonly used to safely write files, i.e. prepare a temp file and then move it into place. it's a good practice, but its safety hinges on the atomicity of rename and its behavior wrt destinations that already exist. it would be nice if SPIFFS_rename behaved closer to POSIX, specifically: it should be atomic and should not fail ifnewPath
exists, it should silently deletenewPath
in this case.see here for detailed spec.