Go Down

Topic: Renameing a file with SdFat (Read 4296 times) previous topic - next topic

jcarrr

I mistyped when I asked this question regarding RTClib.  That would be quite a trick

I need to rename a file on SD card after it is detected and used to configure the device.  I see no way to directly rename a file.  Perhaps copy to a new name and delete the old one, but I see nothing to use to copy either.  Two files open at once for a byte by byte copy seems like a bad idea.

Any suggestions?

Thanks,

JAC

PaulS

You can read more than one byte at a time. Given that SdFat is not a full-blown file system, copy and delete seems to be the only way to accomplish what you want to do.
The art of getting good answers lies in asking good questions.

jcarrr

Can one have more than a single file open at a once, or is it an open-seek-read-close  ---- open/append-write-close dance?

Not a big deal really, just seems kind of grubby.  Everything else in SdFat works like a champ.

Thanks,

JAC

PaulS

Quote
Can one have more than a single file open at a once, or is it an open-seek-read-close  ---- open/append-write-close dance?

You'll let us know when you try, right?
The art of getting good answers lies in asking good questions.

jcarrr

A buffer-full at a time works fine.  It took less time to do it than to complain about it

jac

PaulS

Excellent. If you make a function out of it, it becomes re-usable. You might even post the function here, for others that want to do something similar.
The art of getting good answers lies in asking good questions.

Go Up