Hi,
I am trying to use copyfiles() function to copy one file, it works but also display file content - why? or how to turn it off.
my code:
void copyOneFileFs()
{
String fn=SearchFileName();
Serial.println(fn);
int err = fs.mount(&fs_data);
String fname1="/fs/";
fname1.concat(fn);
fname1.concat(".col");
String fname2="/usb/";
fname2.concat(fn);
fname2.concat(".col");
Serial.println(doesFileExistFs(fn+".col"));
Serial.println(doesFileExistFs(fn+".get"));
Serial.print("copy: ");
Serial.print(fname1);
Serial.print(" to: ");
Serial.println(fname2);
copyfiles(fname1,fname2);
Serial.print("done.");
}
where SearchFileName() is an file name input function and doesFileExistFs() check if file exist.
the output form it looks like that:
123
Done
-----exist------123.col
1
Done
OK
0
copy: /fs/123.col to: /usb/123.col
copy from: /fs/123.col to: /usb/123.col
reregfddg
done.
123 is entered file name,
but "reregfddg" is content of the file, but I did not ask to display it in the code, does copyfiles() has it by default? how to turn it off?
Regards