thanx, but I only used 8 characters long names with no spaces, just like ABCDEFGH.mp3
Since nobody else suggested a solution to such a simple problem, then I guess it's simply something that shouldn't happen. Or maybe it depends on the bare conductive board.
How do you create your files on the SD? Do you use a PC with Windows, a Mac, or Linux?
Names like ABCDEFGH.mp3 are not considered long file names by Windows. The rule is that 8.3 names that have all upper or all lower case in the base name and all upper or all lower in the extension are short names.
These are short 8.3 names: BASE.EXT, BASE.ext, base.EXT, base.ext. Windows uses two bits in the short directory entry to indicate the character case of the base and extension.
Some programs create an incorrect extra entry. Try using Windows to check the SD for file system errors.
Try formatting the SD with SD Formatter on Windows and recreate the files on Windows.
ok, so the problem must be in the process of copying the files into the sd card. It doubles every file I copy in it and changes its name with ~ and numbers.
It does it anyway, also if I put a file named P.MP3 then I will have two files in the directory, one named correctly P.MP3 and another named _~1.MP3
I tried with changing the length of the file names up to 8 characters but nothing changed.
like TRACK001.MP3 becomes _TRACK~1.MP3
it looks like the names are too long or contains empty spaces but it's not (at least on the mac view). Will try to copy files from a windows machine.
your code up here doesn't seem to work anymore.
The isHidden() property returns an error. Is a way to get this boolean some other way?
I posted also in a separate topic, but will copy the solution if I find it.
it is very useful for me.
I had the same problem. The one thing I noticed about the duplicate files is that they all had a ~. So I just ignored files that had a ~ in them. It is kinda a hack, but it works. Just don't legitimately put a ~ as part of your file names.
String file_name = entry.name();
if( file_name.indexOf('~') != 0 )
{
//This is an actual file.
}
I was trying to count the files in a directory and I would always have double files until I started ignoring all files with ~.