Go Down

Topic: Bug in SD library Example code (with fix) (Read 686 times) previous topic - next topic

osbock

The listfiles example will fail if you have more than 26 files because it fails to close the files and you run out of file handles.
I discovered this, not by having too many files, but by rewinding the directory as I was scrolling through the files with an LCD GUI.

It's a simple fix, just make sure you close the files when iterating over a directory.

I filed a bug: http://code.google.com/p/arduino/issues/detail?id=832
and the fixed example is:
http://arduino.googlecode.com/issues/attachment?aid=8320000000&name=listfiles.ino&token=MA2OkD4QfvBFDY9sk_S6aeM9Cwo%3A1330552643785

I also did a pull to the adafruit repository version, but I'm not sure if that's active because there's been no response.

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