pyfatfs icon indicating copy to clipboard operation
pyfatfs copied to clipboard

Generating short file name with standard rules

Open fangpingzhen opened this issue 5 months ago • 0 comments

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

fangpingzhen avatar Jul 29 '25 06:07 fangpingzhen