-->
Page 1 of 1

Get LFN from SFN with SDFat

PostPosted: Sat May 15, 2021 12:10 pm
by Nitek
I am trying to optimize the memory usage of my ESP8266 arduino sketch by using 8.3 SFN folder names internally, but LFN when needed for user output. Unfortunately when opening a folder by using the SFN, getName also returns the SFN:

Code: Select allsdfat::SdFile _currentFolder;
_currentFolder.open("BLUBBE~1");
char foldername[100];
_currentFolder.getName(foldername, sizeof(foldername));

results in "BLUBBE~1" while

Code: Select allsdfat::SdFile _currentFolder;
_currentFolder.open("blubberblub");
char foldername[100];
_currentFolder.getName(foldername, sizeof(foldername));

results in "blubberblub" (and getSFN would return "BLUBBE~1"). Is there any chance to open the folder using the SFN "BLUBBE~1", but get the LFN ("blubberblub") later on?