file names changed with tilda "~"

ZarZar
Posts: 4
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: 9766
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: 4
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 1515 times

ESP_Sprite
Posts: 9766
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: 52
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: 4
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.

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

Re: file names changed with tilda "~"

Postby ZarZar » Wed Jun 12, 2024 6:09 am

Hi There,

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

Thanks
Attachments
dir flash 2.jpg
dir flash 2.jpg (16.31 KiB) Viewed 961 times

Who is online

Users browsing this forum: No registered users and 109 guests