Go Down

Topic: Renameing a file with SdFat (Read 3116 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.

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?

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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy