Strange behaviour with filename encoding

All your general support questions for OpenZFS on OS X.

Strange behaviour with filename encoding

Postby Eladio » Tue Sep 27, 2022 10:20 am

I share zpools between osx and ubuntu. Osx has a nfd 'Normal Form' for files names and Ubuntu nfc; so to convert from one to the other I use convmv (as usual).
The file included (sample.tgz) holds a subdir and a file (zero size) whit Spanish names (I think you know that I'm not english :D ). The file was created on my mac, stored on a zfs dataset, and then transferred to an ubuntu zpool (send -wLecR).
If I expand the tgz on an ubuntu dataset and try tou use 'convmv' the result is incredible:

root@ELMSrv:~# cd tmp
root@ELMSrv:~/tmp# tar xzvf ../sample.tgz

Code: Select all
subdir/
subdir/Alc1 - Planificar Gestión Alcance.pdf


root@ELMSrv:~/tmp# ls -l
Code: Select all
total 1
drwxr-xr-x 2 root root 3 sep 27 19:51 subdir


First, check that the filename has to be normalized (dry run of convmv)
root@ELMSrv:~/tmp# convmv -f utf-8 -t utf-8 --nfc -r .
Code: Select all
Starting a dry run without changes...
mv "./subdir/Alc1 - Planificar Gestión Alcance.pdf"   "./subdir/Alc1 - Planificar Gestión Alcance.pdf"
No changes to your files done. Would have converted 1 files in 0 seconds.
Use --notest to finally rename the files.


Now I try to rename an change to NFD (include --notest in convmv)
root@ELMSrv:~/tmp# convmv -f utf-8 -t utf-8 --nfc --notest -r .
Code: Select all
mv "./subdir/Alc1 - Planificar Gestión Alcance.pdf"   "./subdir/Alc1 - Planificar Gestión Alcance.pdf"
Ready! I converted 1 files in 0 seconds.


Well, It seems to do the work, but the filename has been renamed to another (maybe temporal) name
root@ELMSrv:~/tmp# l subdir
Code: Select all
total 1
-rw-r--r-- 1 root root 2 sep 27 19:46 convmvtmp1


Now I think that convmv obviously has a bug... but look at that (try to rename to the original name of the file):
root@ELMSrv:~/tmp# mv subdir/convmvtmp1 "./subdir/Alc1 - Planificar Gestión Alcance.pdf"
Code: Select all
mv: 'subdir/convmvtmp1' and './subdir/Alc1 - Planificar Gestión Alcance.pdf' are the same file
root@ELMSrv:~/tmp#


Ups... 'mv' complains that both files are the same... What's happening?
Attachments
sample.tgz
(194 Bytes) Downloaded 17 times
Eladio
 
Posts: 17
Joined: Fri Feb 05, 2021 11:52 pm

Return to General Help

Who is online

Users browsing this forum: No registered users and 9 guests