SD file listing to UTFT screen

I am using one of the examples in the library to get info from the card using these libraries

#include <SD.h>
#include <SdFat.h>
#include <SdFatUtil.h> // define FreeRam()

The above is included in the main ino for my project the following sub routine is called when the sd card menu is pressed.

void setup_sdcard(void)
{
  

  
   Serial.println("begin_setup_sdcard");

     drawMenu_sub();
      
     myGLCD.setColor(VGA_LIME); 
     myGLCD.setFont(DejaVuSans18);

    myGLCD.setFont(SmallFont);
    Serial.print("\nInitializing SD card...");
    myGLCD.print("Initializing SD Card",20,20);
    myGLCD.print("Initializing SD Card", 275, 400);

    pinMode(SD1_CS, OUTPUT);     // change this to 53 on a mega

  if (!card.init(SPI_HALF_SPEED, chipSelect)) {
    Serial.println("initialization failed. Things to check:");
    myGLCD.print("initialization failed. Things to check:",20,40);
    Serial.println("* is a card is inserted?");
    myGLCD.print("* is a card is inserted?",20,60);
    Serial.println("* Is your wiring correct?");
    myGLCD.print("* Is your wiring correct?",20,80);
    Serial.println("* did you change the chipSelect pin to match your shield or module?");
    myGLCD.print("* did you change the chipSelect pin to match your shield or module?",20,100);
    waitForTouch();
    myGLCD.clrScr();
    myGLCD.drawRect(10,10,799,469);
    myGLCD.drawRect(140,384,668,459);
    Serial.println("end_setup_sdcard");
    drawBttn_main();
    //*****NO SD Card Inserted exit here********


  } else {
    Serial.println("Wiring is correct and a card is present.");
    myGLCD.print("SD Card Present......",20,40);
  }

  

  // print the type of card
  Serial.print("\nCard type: ");
  myGLCD.print("Card   Type: ",20,60);
  switch (card.type()) {
    case SD_CARD_TYPE_SD1:
      Serial.println("SD1");
      myGLCD.print("SD1",240,60);
      break;
    case SD_CARD_TYPE_SD2:
      Serial.println("SD2");
      myGLCD.print("SD2",240,60);
      break;
    case SD_CARD_TYPE_SDHC:
      Serial.println("SDHC");
      myGLCD.print("SDHC",240,60);
      break;
    default:
      Serial.println("Unknown");
      myGLCD.print("Unknown",240,60);
  }
//********************************************************************************************************************
  // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
  if (!volume.init(card)) {
    Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
    myGLCD.print("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card",20,80);
    return;
  }
//****************************************************************************************************************
  
  
  
  
  // print the type and size of the first FAT-type volume
   
  uint32_t volumesize;
  myGLCD.setFont(SmallFont);
  Serial.print("\nVolume type is FAT");
  Serial.println(volume.fatType(), DEC);
  myGLCD.print("Volume Type:FAT",20,80);
  dtostrf (volume.fatType(),2,0,buffer1);
  myGLCD.print(buffer1,240,80);
  Serial.println();
  
  volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
  volumesize *= volume.clusterCount();       // we'll have a lot of clusters
  volumesize *= 512;                         // SD card blocks are always 512 bytes
  
  Serial.print("Volume size (bytes): ");
  myGLCD.print("Volume size (bytes):",20,100);
  Serial.println(volumesize);
  dtostrf (volumesize,8,0,buffer1);
  myGLCD.print(buffer1,240,100);
  Serial.print("Volume size (Kbytes): ");
  myGLCD.print("Volume size (Kbytes):",20,120);
  volumesize /= 1024;
  Serial.println(volumesize);
  dtostrf (volumesize,6,0,buffer1);
  myGLCD.print(buffer1,240,120);
  Serial.print("Volume size (Mbytes): ");
  myGLCD.print("Volume size (Mbytes):",20,140);
  volumesize /= 1024;
  Serial.println(volumesize);
  dtostrf (volumesize,3,0,buffer1);
  myGLCD.print(buffer1,240,140);
  
  Serial.println("\nFiles found on the card (name, date and size in bytes): ");
  myGLCD.print("Files found on the card (name, date and size in bytes): ",20,160);
  root.openRoot(volume);

  //**********************************************************
  // list all files in the card with date and size
  root.ls(LS_R | LS_DATE | LS_SIZE);
  //*********************************************************
  
  waitForTouch();
  myGLCD.clrScr();
  myGLCD.drawRect(10,10,799,469);
  myGLCD.drawRect(140,384,668,459);
  Serial.println("end_setup_sdcard");
  drawBttn_main();

  }

I have everything printing to my tft screen with the exception of this command

  root.ls(LS_R | LS_DATE | LS_SIZE);

I can’t figure out how to get that command to print the TFT it seems that
it is hard coded to print to the serial port or how i would implement the code
it uses to work as a sub routine in my ino to print to the TFT.

Any help is appreciated thanks

Are you sure that the call to openRoot() was successful? If you use the Serial object, can you print out the values for the parameters to ls()?

I can't figure out how to get that command to print the TFT it seems that it is hard coded to print to the serial port

It is. I've already told you that you need to edit the damned function, or replicate the function in your program.

Why haven't you?

1st of all YOU have not told me a dam thing, so your ignorant response to my question is NOT CALL FOR, perhaps you could be more helpful by helping me FIND the function to replicate in the list of files in the sd library. Otherwise why don't you keep your ignorant response to my question to yourself since it is NOT in any way a helpful response to the question.