char name[15] = contents.name(); // <- problem: I dont know the size!
The value that the name() method returns is a pointer to a string. Is it the size of the pointer that you don't know (2 bytes) or the length of the string pointed to? If it's the latter, strlen() can help.
Or, strdup() will use malloc() to allocate space, and return a pointer to the duplicated string. You'll need to free() that memory when you are done with it.
Does the SD class support anything other than 8.3 format names? Don't you really already know the maximum length of the string?
Do you understand that that allocation and assignment will fail, since you can't assign a pointer to char array?