file names changed with tilda "~"

ZarZar
Posts: 3
Joined: Fri Mar 08, 2024 9:45 am

file names changed with tilda "~"

Postby ZarZar » Fri Mar 08, 2024 9:54 am

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.

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: file names changed with tilda "~"

Postby ESP_Sprite » Sat Mar 09, 2024 2:52 am

You probably want to turn on support for long filenames in FAT in menuconfig.

ZarZar
Posts: 3
Joined: Fri Mar 08, 2024 9:45 am

Re: file names changed with tilda "~"

Postby ZarZar » Mon Mar 11, 2024 7:07 am

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 "~".
Attachments
subory flash - disk.png
subory flash - disk.png (43.58 KiB) Viewed 409 times

ESP_Sprite
Posts: 9052
Joined: Thu Nov 26, 2015 4:08 am

Re: file names changed with tilda "~"

Postby ESP_Sprite » Mon Mar 11, 2024 8:30 am

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.

ESP_adokitkat
Posts: 27
Joined: Thu Jun 22, 2023 12:50 pm

Re: file names changed with tilda "~"

Postby ESP_adokitkat » Mon Mar 11, 2024 7:33 pm

Hi, what ESP-IDF version are you using? If you can, try to update it to v5.2 to see if this persist.

ZarZar
Posts: 3
Joined: Fri Mar 08, 2024 9:45 am

Re: file names changed with tilda "~"

Postby ZarZar » Thu Mar 14, 2024 7:46 am

I'm using ESP-IDF version 5.0.4.

I will try to update to 5.2 and report back.

Who is online

Users browsing this forum: No registered users and 191 guests