[SdFat] Storing filename to a string

I tried searching the documentation of SdFat and is unable to find a function that returns the filename. only printName(); , which prints to serial straight away. I want to store the file name in a string.

how do i go about that?

I want to store the file name in a string.

The name of what file?

and is unable to find a function that returns the filename. only printName(); , which prints to serial straight away.

Look at the source code. Obviously that function is able to get the name of a file, so you should be able to use EXACTLY the same process.