Skip to content

Generating short file name with standard rules #45

@fangpingzhen

Description

@fangpingzhen

make_8dot3_name function generates the SFN, truncate the length of body and extension (if it exist) to 8 and 3 bytes respectively. If there is no repetition of SFN, no numeric tail (~N, a tilde followed by 1-6 digits of numerals) will be added. It is different from the FAT spec (https://elm-chan.org/docs/fat_e.html#lfn)

For example:

When I add the folder to FAT16 container with pyfatfs,

Image Image

The short name of the directory entry of FirstNet is FIRSTN~1, the short name of the directory entry of FirstNet_Guam_CNMI is FIRSTNET.
When mounting the container in Linux or Windows, the FirstNet_Guam_CNMI directory entry was found when indexing the FirstNet directory because of the short name match.
Shows duplicate inodes for FirstNet and FirstNet_Guam_CNMI
3176 dr-xr-x--- 2 oracle group test - domain local 16384 May 30 12:33 FirstNet
3177 dr-xr-x--- 2 oracle group test - domain local 16384 May 30 12:33 FirstNet_American_Samoa
3176 dr-xr-x--- 2 oracle group test - domain local 16384 May 30 12:33 FirstNet_Guam_CNMI
3175 dr-xr-x--- 2 oracle group test - domain local 16384 May 30 12:33 Non_VoLTE
3174 dr-xr-x--- 2 oracle group test - domain local 16384 May 30 12:33 VoLTE

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions