FAT file name restrictions?

Been working with the Arduino for simple things for some time now, this is my first real project with storage and multiple peripheral devices. Long story short, I'm trying to read MP3s off a microSD card using the Sparkfun MP3 shield. Using the library provided by Bill Porter (Sparkfun MP3 Shield Arduino Library « The Mind of Bill Porter) I'm able to get a track playing as long as:

  1. the file name follows the 8.3 format (8-character file name, 3-character file extension) and
  2. it is in the root directory

Is there a way to read file names that have an n.3 format and aren't in the root directory? It seems to me that this is a restriction with the FAT library included in the example sketch but I don't know enough to say precisely. Any help would be greatly appreciated in this effort... I've been reading quite a bit and it seems that there may be other libraries that can navigate nested folders but they aren't available for download anymore. :frowning:

[EDIT]
After some more digging, I've found the SD library included with the Arduino install package has the capability to navigate nested folders but is still restricted to the 8.3 naming format. Is there any way around that??

SdFat and the arduino SD library which is a wrapper for SdFat are restricted to 8.3 names.

I am the author of SdFat and decided not to support long filenames since substantial memory is required for long file names.

Very few people have requested long file names so I have not added this feature.

Here is the Long Filename Specification http://www.osdever.net/documents/LongFileName.pdf. It is not straight forward since multiple 8.3 directory entries are used.

I am writing an ARM version of SdFat that will support long filenames and may make long filenames an option for avr arduinos.

Thank you for the reply!It looks like I'm pretty much stuck with the 8.3 file names then.

Forgive my ignorance as I'm still new to working with these file systems (and don't have a way to test until later this evening) but what would displayed if a long file name were to be read by the SD lib? Does it just truncate the name at 8 characters of is it illegible?

Open fails unless its argument is a valid 8.3 filename.

scoobydrvr:
Forgive my ignorance as I'm still new to working with these file systems (and don't have a way to test until later this evening) but what would displayed if a long file name were to be read by the SD lib? Does it just truncate the name at 8 characters of is it illegible?

You can only open a long filename file if you use the short filename equivalent. Use DIR /X in a Command Prompt to find out what it is. e.g. fur_elise.mp3 would be something like FUR_EL~1.MP3.

Hi fat16lib,

THANKS! for your great work with SdFAT! I have it worked well with several cards as documented here: http://arduino-info.wikispaces.com/SD-Cards

BUT, a 1Gb card formatted FAT16 that works fine with SdFAT QuickStart and TinyFAT, fails to ever initialize with fat16lib. What might be happening here? Could it be SPI speed?

Any suggestions appreciated! Any critique/suggestions of the Wiki page would be appreciated.

We will be releasing a Long File Name version of SDFat shortly.
For File/Directory reading,writing,removing. It has been working great here in our test labs.

Glenn Kreisel
glennkreisel@yahoo.com

fat16lib:
I am writing an ARM version of SdFat that will support long filenames and may make long filenames an option for avr arduinos.

Has this come to fruition? An LFN version would be convenient for many applications, especially for the ARM processors where ram is potentially much less of an issue. I'd like to implement an mp3 player using a teensy3.0 where the user could navigate the files for playing etc. using the LFNs, for example.