SD card files found but not found

Hello!

I'm having some difficulties regarding some .bmp files i'm trying to read and display on a small display. I've written up a small test sketch in order to try and figure out why i can't seem to open the file.

At current i've tried multiple different ways of parsing the filename to SD.exists();, such as typing it in directly as a string ( i.e SD.exists("filename.ex"); ), creating a separate variable string to parse into it, and currently i've set it as a char array, and all of these have failed.
I've also tried adding different combinations of slashes and backslashes in case i needed to specify that the file is in the root of the SD card?

I've also added a function to print out all files and directories on the SD card, and using this i can see that the files are there, and the SD library should be able to see and interact with the files, but this has honestly only confused me more, since if i can print out that the file is there, why can't i access it?

Any help or advice is greatly appreciated!

Output in Serial Monitor:

Test Sketch:

#include <SD.h>

File root;
File myFile;

const char catto[] = "catto.bmp";
const char snacc[] = "snacc.bmp";

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  while(!Serial);
  Serial.println("Serial Init.");
  int attempts = 0;
  int maxAttempts = 50;
  int delayBetweenAttempts = 300;

  pinMode(D2, OUTPUT);
  while(! SD.begin(D2) ) {
//    Serial.print("SD Card Init attempt #");
//    Serial.println(attempts);
    attempts++;
    if( attempts > maxAttempts ) {
      Serial.println("Giving up");
      //while(1);
    }
    delay( delayBetweenAttempts );
  }
  Serial.println("SD initialization done.");
  root = SD.open("/");
  printDirectory(root, 0);
  Serial.println("Setup Done.");

}

void loop() {
  // put your main code here, to run repeatedly:

  if(SD.exists(catto)){
    Serial.println("Catto Exists");
  }
  else{
    Serial.println("No Catto");
  }
  delay(1000);

  if(SD.exists(snacc)){
    Serial.println("Snacc Exists");
  }
  else{
    Serial.println("No Snacc");
  }
  delay(30000);

}



void printDirectory(File dir, int numTabs) {

  while (true) {
    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }

    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}

Just a WAG, but perhaps:

const char catto[] = "/catto.bmp";
const char snacc[] = "/snacc.bmp";

Strange you should suggest that, none of my test examples for SD work if there is not a / in front of the filename.

Thank you, that worked!
I could've sworn i'd tried that before, but i guess not.

Any good suggestions as to why the following wouldn't work?

if(SD.exists("/catto.bmp")){
    Serial.println("Catto Exists");
  }

Because i know i've tried that, and it certainly didn't work.

I would think that would work. Try it again.

and it does work, i guess i must've used a backslash.