Class "SdFat" and "File" -> name() does not work!!!

Hello everybody,

For my current project I use the SdFat library (1.0.5) and the File library.

All functions run without problems. However, I still have to write a function to determine the file names. It is obvious to me that the function "name ()" of the class "File" does not work.

#include "SdFat.h"
SdFat      sd;
String dirName = "/";
File file =, O_READ);
Serial.println("dir: " + (String);

I get the message:

dir: use getName()

LoL, but the File Class does not have any method named getName()!!! How to solve this Problem?

By the way: I use the File class instead of the SdFile class because it actually offers everything and is well documented!

I am not familiar with the File library.


Ok, thanks. I have switched to SdFat with SdFile lib!

I had another thread in contact with fat16lib. At that time we had exhausted ourselves in detail about the classes SD SdFat File and SdFile. The SD and File classes are old implementations / wrappers of the SdFile class and do not seem to be 100% compatible with current versions of SdFat and SdFile.

Also for performance reasons I will only bet on SdFat and SdFile. Greetings.