SD Card file count
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- philg
- Posts: 90
- Joined: Sun Mar 06, 2011 4:42 pm
SD Card file count
I have a working Wave Shield with a 256MB SD card that contains a number of .wav files at the root. Is there a function that will return the number of .wav files stored there? I have searched the .h files but the only thing close was rootDirEntryCount but that returns 512 and I only have about 30 files on the card.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: SD Card file count
The SD interface is fairly basic.
To list the files in a directory, you have to open the directory then call dir.openNextFile() until it runs out of files. The 'listfiles' sketch in the SD examples shows how it's done.
To list the files in a directory, you have to open the directory then call dir.openNextFile() until it runs out of files. The 'listfiles' sketch in the SD examples shows how it's done.
Please be positive and constructive with your questions and comments.