0

I have some similar music libraries which I would like to remove duplicates on (which are contained in a Disc Volume I'm loading wirelessly from a QNAP server). I know there are applications which can achieve this (iTunes may even be able to handle the job) and may end up going that route.

At the moment experimenting with a Python script. Many of the files are named with non-ASCII characters and I'm noticing some odd behavior, illustrated below:

mikes-mbp-2:Multimedia mikekilmer$ ls -l Babel7/ | grep Šaban
ls: Šaban Bajramović: No such file or directory
-rwxrwxrwx  1 mikekilmer  staff     0 May  7 00:48 Šaban Bvić
mikes-mbp-2:Multimedia mikekilmer$ ls Babel7/ | grep Šaban
Šaban Bajramović
Šaban Bvić

I know there's a CD by an artist named Šaban Bajramovic. Sometimes it's visible in the finder and sometimes not, and it comes up in ls, but not ls -l!

It's not just the filename because I can make a text file with the same name and it seems to behave normally:

mikes-mbp-2:Multimedia mikekilmer$ touch Šaban\ Btwo
mikes-mbp-2:Multimedia mikekilmer$ vim Šaban\ Btwo 
mikes-mbp-2:Babel7 mikekilmer$ ls -l | grep Šaban
ls: Šaban Bajramović: No such file or directory
-rwxrwxrwx  1 mikekilmer  staff     0 May  7 00:48 Šaban Btwo

Then I thought, maybe it's just one of the non-ASCII characters and tried creating a new file including BOTH non-ASCII characters and got THIS:

mikes-mbp-2:Babel7 mikekilmer$ mv Šaban\ Btwo Šaban\ Bvić
mikes-mbp-2:Babel7 mikekilmer$ ls -l | grep Šaban
drwxrwxrwx  1 mikekilmer  staff   264 Apr 22 23:40 Šaban Bajramović
-rwxrwxrwx  1 mikekilmer  staff     0 May  7 00:48 Šaban Bvić

There's also a file with a non-ascii character behaving similarly:

mikes-mbp-2:Multimedia mikekilmer$ ls -l Babel7/Switzerland_/Morrow\ 78\ Collection_/ | grep Strömpf
ls: Drei Lederne Strömpf_.mp3: No such file or directory
mikes-mbp-2:Multimedia mikekilmer$ ls Babel7/Switzerland_/Morrow\ 78\ Collection_/ | grep Strömpf
Drei Lederne Strömpf_.mp3

In he case of Drei Lederne Strömpf_.mp3, it is visible in the finder.

Based on python code, I'm fairly certain the OS is using utf-8 encoding.

I'm currently downloading the Šaban Bajramović directory to a local drive to see if it behaves any differently.

Insights hoped for.

  • Well - I've ssh'd into the QNAP - which is a unix-based Network Attached Storage system - and am getting the same behavior with the non-ASCII names following ls and ls -l commands. The python script I'm using is actually working when run ON the server, where it was giving (intermittent?) file not found errors when run via the local terminal via the Volumes directory. Hmmm. – MikeiLL May 7 '15 at 6:55
  • After downloading the Šaban Bajramović directory to local drive, it behaves as expected. – MikeiLL May 7 '15 at 7:01

You must log in to answer this question.

Browse other questions tagged .