Running SD and SdFat in the same project.

rickyelqasem:
Why add a load of complexity for myself when there is a workable solution?

I haven't tried it, but I think all you had to do was change the "#include <SD.h>" to "#include <SdFat.h>".
IIRC, it seems like there is one different thing to get the filename from the directory object. PaulS was trying to lead you down that path. Instead, you kludged up a big steaming pile of "it works."

I'm interested in what the alternative is. Is it merely creating an object?

On a desktop, with an OS and virtual memory on an external hard drive, sure! Instantiate all you want! Be sure to reboot once per day.

In an embedded environment, only read one filename at a time. Read another when you're ready for the next one. Don't store them all in RAM.

Filenames can be very efficiently stored in RAM with a plain old C string (note the lowercase "s"). These are just char arrays. Both SD libraries provide C string filenames, but your code converted them to the wasteful String objects. :frowning: