How to fix error: Name is too long

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
judoka1113
Posts: 2
Joined: Thu Dec 02, 2010 3:51 pm

How to fix error: Name is too long

Post by judoka1113 »

I constantly get error message
Error: File name too long(/name_of_file)
What can I do to fix this problem.
Thanks.
Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: How to fix error: Name is too long

Post by Rolcol »

What filesystem are you downloading to? While the torrent is in Transmission, there's no way to change it from the name listed in the .torrent file.
judoka1113
Posts: 2
Joined: Thu Dec 02, 2010 3:51 pm

Re: How to fix error: Name is too long

Post by judoka1113 »

I'm downloading to my /home/yuri/downoads directory. It makes no sense to me why they set up Transmission not to accept the files with long names. Why have the length of the name dictate which torrents can be downloaded and which can't? Is there a way to set Transmission to accept long names?
Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: How to fix error: Name is too long

Post by Rolcol »

It's not a limitation of Transmission, it's a limitation of the operating system or file system.
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

Rolcol wrote:It's not a limitation of Transmission, it's a limitation of the operating system or file system.
Thank you Captain Obvious. But how to get off this error?
Is there feature to automatically rename file to fit it to filesystem limitation?
E.g. many posters use single-byte encoding FSes to store files, and if downloader uses UTF-8 filesystem, he get error if file name is a half of filename length limit, but uses national characters.
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

Moreover, even if offending file is excluded, transmission stops with the error "file name too long" on it.
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: How to fix error: Name is too long

Post by blacke4dawn »

fidoman wrote:
Rolcol wrote:It's not a limitation of Transmission, it's a limitation of the operating system or file system.
Thank you Captain Obvious. But how to get off this error?
Is there feature to automatically rename file to fit it to filesystem limitation?
E.g. many posters use single-byte encoding FSes to store files, and if downloader uses UTF-8 filesystem, he get error if file name is a half of filename length limit, but uses national characters.
It may be obvious to you but not to everyone, and certainly not to "Average Joe" users. The only real fix to this is to "fix" the OS or FS. Automatic renaming can be dangerous and will certainly take significant resources in getting it done properly, especially in consideration to where to apply the renaming.
As for an issue with using different bit-lengths in different file systems then that is still an issue within the OS and not something that Transmission should "compensate" for.
bugmenot
Posts: 3
Joined: Sat Aug 06, 2011 9:41 pm

Re: How to fix error: Name is too long

Post by bugmenot »

FYI, sometimes OS can provide a way to truncate filename at VFS level, e.g. http://docs.freebsd.org/cgi/mid.cgi?201 ... 31.GA78089.
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

blacke4dawn wrote: As for an issue with using different bit-lengths in different file systems then that is still an issue within the OS and not something that Transmission should "compensate" for.
But, if agree to this concept, we have as a consequence that if somebody creates a torrent with long filename (e.g. he has very rare FS without limitations), there is no way to download it.

Enabling trunkation is not possible in modern OSes (e.g. discussion http://compgroups.net/comp.unix.solaris ... -Solaris-8).

I've tried to modify torrent file to change names, but it resulted in "torrent not registered".
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

The issue appears on Solaris due to UTF-8 encoding, used there.
At Windows, NTFS uses at least two bytes for any character (UTF-16), and it guarantees 255 byte pairs (510 bytes).
At Solaris, ZFS uses at least one byte (UTF-8), and amount of space reserved is 255 single bytes, not pairs, so 255-byte length name is possible only if all characters used are ASCII.
So in windows you can use 255-char long nationalized name, but when you try to create the same name on solaris, you may hit name length limit, as 255-character long string may expand to 510 bytes.
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: How to fix error: Name is too long

Post by blacke4dawn »

Not properly converting from UTF-16 to UTF-8 is either a failure of the OS or no indication of what encoding it was presented as originally. A properly done encoding conversion leaves the number of characters (keyword here is CHARACTERS, not bytes) the same, regardless of how many bytes are used per character in each encoding.

Just taking a UTF-16 character and chopping it up into two UTF-8 characters is an invitation for disaster. It's just not done not only for name length reasons but also to avoid "getting" the control characters, which I believe are the first 32 ASCII characters. The control characters are also labeled non-writable since they have no graphical representation, ever. Just chopping up UTF-16 characters into UTF-8 will most likely lead to one or more of these control characters being present in the file name.
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

blacke4dawn wrote:Not properly converting from UTF-16 to UTF-8 is either a failure of the OS or no indication of what encoding it was presented as originally. A properly done encoding conversion leaves the number of characters (keyword here is CHARACTERS, not bytes) the same, regardless of how many bytes are used per character in each encoding.

Just taking a UTF-16 character and chopping it up into two UTF-8 characters is an invitation for disaster. It's just not done not only for name length reasons but also to avoid "getting" the control characters, which I believe are the first 32 ASCII characters. The control characters are also labeled non-writable since they have no graphical representation, ever. Just chopping up UTF-16 characters into UTF-8 will most likely lead to one or more of these control characters being present in the file name.
Conversions are correct. No any choppings, you do misunderstand.
Filename with 160 cyrillic letters in file name is OK under Windows: there are 510 bytes of space for 255 UTF-16-encoded characters, and 320 bytes of encoded filename are acceptible.
But under *nix-es, which use UTF-8, limit is 255 BYTES, so 255 characters length can be achieved only if all symbols are latin (32-126). But that same 160 cyrillic letters become 320 bytes and hit limit.
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: How to fix error: Name is too long

Post by blacke4dawn »

No, you misunderstand. Properly done one UTF-16 character is converted to one UTF-8 character, and in essence halving the byte length. You right now believe that one UTF-16 is converted to two UTF-8, which just isn't done due to the "risks" I mentioned above. That is why we say what encoding it has so it can keep the same amount of CHARACTERS regardless how many bytes are used per character. As long as the character limit is the same and it can do a proper conversion there is no issue with name lengths.

Technically speaking they don't need to be in the lower region since that is what conversion tables are for, unknown ones, a.k.a outside of the conversion table, will be given a default one (most often the square one).


I repeat it again, ONE character to ONE character regardless of byte length, that is proper conversion. If your system doesn't do proper conversion then that is something that the Transmission devs can't help you with.
fidoman
Posts: 8
Joined: Thu Aug 04, 2011 7:10 am

Re: How to fix error: Name is too long

Post by fidoman »

I think it is impossible to explain anything if you don't understand that one character in UTF-8 is encoded by variable count of bytes, but unix'es e.g. linux and solaris do limit length of file name by BYTES not CHARACTERs.
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: How to fix error: Name is too long

Post by blacke4dawn »

But file systems are also limited in the character sets that they can use, so they need to be converted into something that that particular file system supports, hence my use of characters as the limiter. As I said, no properly written filehandling routine will write a two-byte character as two one-byte character on a file system that can only handle single byte characters. This is so that the file name is consistent regardless of "what" reads it.

Also found this when looking over a file system comparisons:
Most Windows programms will fail when full path exceeds 255 characters (including Explorer and CMD.EXE). Linux has a pathname limit of 4,096.
Post Reply