Go Down

Topic: SD card suggestion (Read 4704 times) previous topic - next topic


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


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

Using what library?


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.


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


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.


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

Go Up