If I take the SD example "listfiles.ino" and run it on my Uno+Wireless SD shield, it lists the files on the SD card. So far so good.
If I add a single SD.exists call at the start, like this:
if(SD.exists("META.DAT")) // <----- ADDED THIS
{
Serial.println("EXISTS");
}
else
{
Serial.println("DOESN'T EXIST");
}
root = SD.open("/");
if(root)
{
Serial.println("root opened");
printDirectory(root, 0);
}
then the directory listing now returns nothing at all. The SD.open() still succeeds, but the call to dir.openNextFile() inside printDirectory() always fails.
It doesn't matter if the file I'm testing for actually exists on the SD card or not - SD.exists() returns the right result, but in either case dir.openNextFile() will fail.
This looks like I bug, unless I'm misusing it in some way...