Pages: [1]   Go Down
Author Topic: SD card suggestion  (Read 2030 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 128
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some type of mechanism for traversing through the files of a directory.

In sdfatlib you did something like this:
dir_t dir;
char name[13];
while(folder.readDir(&dir) != sizeof(dir))
{
SdFile::dirName(dir, name);
//Then do whatever with the file or file name
}
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 610
Posts: 49044
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Some type of mechanism for traversing through the files of a directory.
Using what library?
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1631
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The SD library is a wrapper to make SdFat easier to use so traversing directory files may not be appropriate for SD.h.

I have a new version of SdFat in test that has many new features including path-names and easier initialization http://code.google.com/p/beta-lib/downloads/list.
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just find another library that can do it, mainly because I hate waiting for other people to do something so that I can do something

FatFs from http://elm-chan.org/fsw/ff/00index_e.html
I've been using it for years now, AVR example code is provided
The function f_readdir will do exactly what you want, which is to iterate through files in a directory
http://elm-chan.org/fsw/ff/en/readdir.html
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1631
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SdFat can read directory files and open entries.  The tail example shows how.

The SD wrapper released by the Arduino team does not expose many SdFat features.

Download from http://code.google.com/p/sdfatlib/ to use SdFat without the wrapper and get the examples.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can also use the full SD fat API from the SD library that comes with Arduino.  Its header files are include by the main SD.h. 

On the other hand, maybe we can find a way to converge the simplicity of the SD wrapper with the power of the full sdfatlib (or beta-lib)?  Probably the best way would be to discuss it on the developers mailing list: http://mail.arduino.cc/mailman/listinfo/developers_arduino.cc
Logged

Pages: [1]   Go Up
Jump to: