Using SdFat with String

Hello everybody,

Having problem with the SD library (see my post "Problem with SD library" in the section "TroubleShooting), I am going to use the SdFat library.

I would like to know how to use the "printName" method to get the result in a String object.

Thank you for your help.

Pierre

The following will get the file name for myFile and place it in an Arduino String.

  SdFile myFile;
  char tmp[13];

  // code to open mfFile goes here

  myFile.getFilename(tmp);
  String name = tmp;

  // verify that the file name is in the String.
  Serial.println(name);

The output for a test case is:

TEST.TXT

Thank you Fat16lib, I just have to use the alternate method getFileName(char*).

Pierre