SD Shield: Copy/Rename Files

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tr01
 
Posts: 4
Joined: Tue Mar 29, 2016 5:12 am

SD Shield: Copy/Rename Files

Post by tr01 »

Hi,

I'm building a data logger using Arduino and Adafruit's Micro SD breakout board.
The program uses the Arduino core SD library.

So, the thing is: the Arduino should log the data once a minute to a file. So far, there's no problem.
But once a hour, the Arduino should create a backup of the logfile. The program should copy the file from the root of the SD to the backup-folder.

I didnt find a function to copy files on the SD card.

How can I do this?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: SD Shield: Copy/Rename Files

Post by adafruit_support_mike »

There is no copy function.

You'll have to open two files, read the old one, and write the same information to the new one.

User avatar
pierrot10
 
Posts: 349
Joined: Tue Nov 17, 2015 4:34 pm

Re: SD Shield: Copy/Rename Files

Post by pierrot10 »

Hello,
Would it be a good idea to add the rename/move function to be able to rename a file?
I think it could be a very good option.
Cheers

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: SD Shield: Copy/Rename Files

Post by adafruit_support_mike »

It isn't our library.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”