10 years, 8 months ago.

File rename problems

I'm working on a program that samples data and store the samples in a file on the SD Card. Every minute the output file shall be renamed to a filename that contains the timestamp, but I can not get the file rename to work.

The SD File System is defined as

SDFileSystem    sd(p5, p6, p7, p8, "sd");   //! mosi, miso, sclk, cs

When I execute the following:

res = rename("/sd/output.tmp", "/sd/08141342.dat");

it returns -1.

If I do

res = rename("/sd/OUTPUT.TMP", "/sd/08141342.dat");

it returns 5.

The file OUTPUT.TMP exists, and the destination file does not exists.

What am I doing wrong, or missing?

Henrik

Be the first to answer this question.