[FATFS] filename and extension not preserving case-sensitive style
Posted: Tue Apr 17, 2018 9:08 am
Hi everybody,
We use file system FATFS to store some files. File should be saved with "case-sensitive" name (i.e. "FOO.txt" is different from "foo.txt"). However I have checked that FATFS choose at its rights the name and extension upper-case, lower-case or camel-case..
In practice if I write a file with name "foo.TXT" with code
and then I read the dicrtory with code
I got from debug
In practice the extension of the file has been lower-cased. Is it correct a behaviuor like this?
Shouldn't I rely on the case sensitive of FATFS?
Thanks
We use file system FATFS to store some files. File should be saved with "case-sensitive" name (i.e. "FOO.txt" is different from "foo.txt"). However I have checked that FATFS choose at its rights the name and extension upper-case, lower-case or camel-case..
In practice if I write a file with name "foo.TXT" with code
Code: Select all
FILE *fp = fopen("/D/SYSTEM/foo.TXT", "w");
if (fp != NULL)
{
if (fclose(fp) == 0)
{
Error = FALSE;
}
}
Code: Select all
DIR* dir; // pointer to the scanned directory.
struct dirent* entry; // pointer to one directory entry.
dir = opendir("/D/SYSTEM");
if (!dir)
{
ESP_LOGD(TAG_FS, "Failed to open dir %s for reading:%d", stringIn, errno);
}
else
{
// scan the directory
while ((entry = readdir(dir)))
{
ESP_LOGD(TAG_FS, "file:%s", entry->d_name);
}
closedir(dir);
}
Code: Select all
D (2568348) fs: file:foo.txt
Shouldn't I rely on the case sensitive of FATFS?
Thanks