Page 1 of 1

file names changed with tilda "~"

Posted: Fri Mar 08, 2024 9:54 am
by ZarZar
Hi There,

I have been trying to write to flash. I have the following entry in my CMakeLists.txt

Code: Select all

fatfs_create_rawflash_image(storage ../site/dist FLASH_IN_PROJECT)
One of the files I have is named index-DiwrgTda.css

I use the following code to enumerate through the files.

Code: Select all

 DIR *d;
    struct dirent *dir;
    d = opendir("/store/assets");
    if (d)
    {
        while ((dir = readdir(d)) != NULL)
        {
            printf("%s\n", dir->d_name);
        }
        closedir(d);
    }
The results seem to have changed the file name to look like the following
INDEX-~1.CSS

Hence the files are not what I expect them to be.
Any help as to why this is would be greatly appreciated.

Thanks.

Re: file names changed with tilda "~"

Posted: Sat Mar 09, 2024 2:52 am
by ESP_Sprite
You probably want to turn on support for long filenames in FAT in menuconfig.

Re: file names changed with tilda "~"

Posted: Mon Mar 11, 2024 7:07 am
by ZarZar
Support for long filenames in FAT in menuconfig is turned on.

4 files are placed on the FAT :
index.html
/assets/react-CHdo91hT.svg
/assets/index-DiwrgTda.css
/assets/index-MJNRYYyu.js


CMakeList.txt :

Code: Select all

fatfs_create_rawflash_image(storage ../site/dist FLASH_IN_PROJECT)
Listing from FAT /store/assets is :
REACT-~1.SVG
INDEX-~1.CSS
index-mjnryyyu.js


2 files have a modified name with a "~".

Re: file names changed with tilda "~"

Posted: Mon Mar 11, 2024 8:30 am
by ESP_Sprite
Weird. If you indeed get "index-mjnryyyu.js" back from the esp-idf programs listing, long filenames is working, as otherwise filenames would be limited to 8.3 characters. I have no idea why this would happen with some files but not with others.

Re: file names changed with tilda "~"

Posted: Mon Mar 11, 2024 7:33 pm
by ESP_adokitkat
Hi, what ESP-IDF version are you using? If you can, try to update it to v5.2 to see if this persist.

Re: file names changed with tilda "~"

Posted: Thu Mar 14, 2024 7:46 am
by ZarZar
I'm using ESP-IDF version 5.0.4.

I will try to update to 5.2 and report back.

Re: file names changed with tilda "~"

Posted: Wed Jun 12, 2024 6:09 am
by ZarZar
Hi There,

the new version ESP-IDF 5.2.1 solved my problem with files on FAT.
The file names are now preserved.

Thanks