You are not logged in.

#1 2010-03-07 17:33:05

zowki
Member
From: Trapped in The Matrix
Registered: 2008-11-27
Posts: 582
Website

File name too long

I wanted to migrate my music collection from windows to linux having finally fixed syncing with my iphone using gtkpod. So heres what happens when I try to copy one of the files:

shaun@hacktop /media/shaun/Music % cp -r * ~/music
cp: cannot create regular file `/home/shaun/music/Touhou lossy music collection/[COOL&CREATE]/2005.05.04 [CCCD-0008] 東方ホムーラン (東方アレンジセルフアレンジ) [例大祭2]/COOL&CREATE - ビートまりお - 博麗神社例大祭参加記念と称してこんなやっちゃった感あふれるCD作っちゃったけどどうしようという後悔の念を微妙に溢れさせつつだらだらと約8分間ほど喋った。.mp3': File name too long

I myself never realized I had such a long filename in my music collection. I am copying this file from an ntfs partition to a ext4 partition (both filesystems support 256 byte file names right?). If each unicode character is two bytes in size and that file has 104 characters in the filename (I counted) then it should be only 208 bytes in lengh. Why does it give me this error?

PS: I don't wish to rename it to something shorter since all my music filenames have to conform to the same format which makes life a lot easier when ID3 tagging and stuff.

Last edited by zowki (2010-03-07 17:33:32)


How's my programming? Call 1-800-DEV-NULL

Offline

#2 2010-03-07 17:50:15

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: File name too long

The filename appears to be 261 bytes long to me.  In UTF-8 encoding, characters may be more than two bytes long -- they can also be three or even four bytes long.

I'm afraid you're out of luck with this filename.

Edit: Wikipedia says NTFS filenames may be up to 255 UTF-16 code units -- each "code unit" is exactly two bytes long and should cover a reasonable subset of Unicode, which gives you maximum filename of 255 characters, that'll take up to 512 bytes of storage.

Last edited by Oxyd (2010-03-07 17:54:04)

Offline

Board footer

Powered by FluxBB