INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: File Name Too Long  (Read 13622 times)

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
File Name Too Long
« on: December 03, 2015, 07:22:59 pm »

After importing a music library, I sometimes get the error message that some files weren't imported because the file name is too long. What is the maximum number of characters for an importable file name?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: File Name Too Long
« Reply #1 on: December 03, 2015, 07:33:18 pm »

I think it's 152 characters after the drive letter.  It's close to that.  You might try moving some or all of your music to a folder that's near the root of the drive to eliminate some length in the path name.  Like if you had M:\tuneup\Music\Jazz\Miles Davis\Kind Of Blue\So What.flac , you might just move everything below Jazz to M:\ . 

I'm not sure what your layout is; just trying to illustrate the point and give you ideas.

Brian.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72380
  • Where did I put my teeth?
Re: File Name Too Long
« Reply #2 on: December 03, 2015, 07:42:41 pm »

I believe the limit for the total path/filename is something like 250 + a few.  You could find it with an Internet search.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #3 on: December 03, 2015, 11:48:05 pm »

The Windows API MAX_PATH limit is 260 characters. However, this includes 4 "extra" characters, the drive letter identifier and a null terminator in the string. Therefore:

[drive][:][\] [path] [null] = 3 + 256 + 1 = 260

So, for drive-letter-based paths, the limit is 256 for the "actual" path.

Unicode APIs in Windows have longer limits, but these cannot be fully utilized for all functionality. In particular, Windows Explorer itself is still (as of Windows 10) subject to the 260 character path restriction, and this includes file operations done via Windows Explorer.

The long-and-short of it is this: MC cannot rely on these files working correctly in all cases, so they are not imported, and you should fix them because they can cause other issues in other applications, including Windows itself.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: File Name Too Long
« Reply #4 on: December 04, 2015, 04:44:15 pm »

If the problem is literally that the FILE name is too long (not the path), that's one of many reasons why it's troublesome to name files using the name of the song title (or movie title or whatever). Such titles can be long or very long, AND they can include characters, symbols and punctuation that are not legal in file names. These restrictions make it unlikely that any library can consistently use actual/exact/complete titles as file names.

MC to the rescue! I use MC's Rename action to name all my files consistently, using an expression that meets my needs. I combine artist and title to form the file name, then truncate the file name to a moderate length. I also force the file name to all lowercase to avoid conflicts when encountering Unix/Linux storage. Then, if there's still a problem such as illegal character, MC Rename automatically changes it.

Also helpful, if an existing file already has the same name, MC appends a number to make it unique. Though I try to avoid this by giving semi-dupe files a suffix code (via a custom field) that remind me why they exist (different mix, for instance); my Rename expression includes this code so the files are named uniquely under my control.

I'm happy with this type of naming because the real power is in MC's database, which contains the full name/title including whatever characters, symbols and punctuation I desire, AND the path and name of whatever the file is.

Once you get into the Rename action and realize its power, many types of file naming and organization are possible. For instance, I use a Directory Rename expression to put files into a-z directories based the file first name (which in my case is the artist's last name/group name, via a custom field).

Also, Rename puts lesser songs into a separate folder tree. These are songs I want to retain in my library, but rarely will actually play. I do this to keep the main files storage from bloating. A Directory expression steers files to main or minor folders based on my custom Rank field. (I avoid using the built-in Stars system to avoid user errors.)

Once set up, Rename is a one-click action to process any number of files, getting them all named and organized exactly as I want them.

(My only wish is that MC would let me store and invoke several Rename setups, and/or store them per-library, because I have different ways to organize music, other audio, video, photos, and even xmas music.)
Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #5 on: December 04, 2015, 04:51:20 pm »

(My only wish is that MC would let me store and invoke several Rename setups, and/or store them per-library, because I have different ways to organize music, other audio, video, photos, and even xmas music.)

It does:
http://wiki.jriver.com/index.php/Rename,_Move,_and_Copy_Files#Presets
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: File Name Too Long
« Reply #6 on: December 04, 2015, 04:54:20 pm »

I also force the file name to all lowercase to avoid conflicts when encountering Unix/Linux storage.

Quote
Linux and nearly every flavor of Unix support mixed case file names.  Not that it matters much but...
(My only wish is that MC would let me store and invoke several Rename setups, and/or store them per-library, because I have different ways to organize music, other audio, video, photos, and even xmas music.)

Are you aware of the RM&C tool's Presets?  The Preset button is in the lower left hand corner of the tool.  You can save your templates and give them names so you can recall them easily.  They *do* seem to be global though.  Meaning that they are not unique to each library.  But that doesn't seem like much of a limitation.  (Edit:  Glynor snuck in on me and got there first.  I guess you owed me one Glynor.  :)  )

For the record, RM&C is one of my favorite MC tools!  :)

Brian.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #7 on: December 04, 2015, 04:56:28 pm »

If the problem is literally that the FILE name is too long (not the path)

Minor point of clarification: The path is the filename and the filename is the path. The shell exposes them separately, but as far as the underlying OS and filesystem is concerned, the filename is:
M:\Audio\Music\A\Aphex Twin\Richard D. James Album\02 - Cornish Acid.mp3

Not:
02 - Cornish Acid.mp3
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: File Name Too Long
« Reply #8 on: December 04, 2015, 09:02:52 pm »

The path is the filename and the filename is the path.

Yes, and therein lies the trap. A long file name with a short path might behave fine, but if the file gets moved or copied to a long path, trouble can ensue. Backup apps are famous for putting files in deeply nested folders, for instance. I avoid hassles by limiting the file name length.

The same "be prepared" notion is why I force file names to lowercase; it eliminates a possible problem. I've encountered many Linux/Unix systems that happily treat "Beatles" and "beatles" as different file names.
Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #9 on: December 05, 2015, 04:01:39 pm »

Thank you all for the responses. First let me say I am not a computer nerd, but an a/v guy trying to build his first music server after many disappointments with an Olive 04HD and many more disappointments with Olive Media the company: the worst corporate behavior I've ever encountered and I've been an a/v dealer for over 25 years. Just so you know the system, it consists of a Bel Canto REFStream renderer with files stored on a Synology 214play, MC20 stored on various PCs and JRemote on iPad Air. (I don't want to switch to MC21 until I have the system completely working well on MC20.)

So I don't even know how to easily find the file name/path. I right-clicked on the album title in MC20 and right-clicked on the album title in the NAS drive itself and neither one gave me that info. So how do get this info?

I will look into RM&C tool's presets and I haven't used it before. MusicHawk, I really appreciate your detailed explanations, but I'm not sure I have the computer abilities to follow your suggestions.

Suggestion: It would be helpful when MC gives the message that some file names were too long to be imported, that it named these files so that out of the thousands of CDs I'm working with, I would know where to look for them. Right now I haven't a clue which files are not being imported. If this info shows up in some log, please let me know where to find it.
Logged

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #10 on: December 05, 2015, 05:54:57 pm »

I can't find the RC&M tool under Tools nor could I look it up in the Wiki. How do I get to it?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: File Name Too Long
« Reply #11 on: December 05, 2015, 05:57:25 pm »

^

Select some files.  Tools > Library Tools > Rename, Move, and Copy files.  This is on the right click menu also.

But I think you might be getting ahead of yourself a tiny bit.  If MC hasn't imported the files, then it can't rename them.

Brian. 
Logged

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #12 on: December 10, 2015, 12:45:58 am »

Right you are Brian. If MC can't tell me which files are too long in a collection of thousands of CDs, it seems I will only find out when I try to find a CD that I know I've ripped into the server, but is absent from the library. Any other ideas for identifying these files?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #13 on: December 10, 2015, 12:51:36 am »

If it refuses to import them, the filenames will be included in the import log. This is accessible if you run a manual Run Auto-Import Now scan and then click the Details button. It should have a section like this:

In-depth details:
Skipped (filename too long):
    M:\Incoming\Really\Really\Long\Path\with_a_super_long_File_Name_maybe_too_for_good_measure_and_all_that_jazz.flac


Copy-pasta it to a text file and you can read them easy and hunt them down.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: File Name Too Long
« Reply #14 on: December 10, 2015, 01:20:13 am »

There's a handy program called TLPD, which you can download here, which will help you identify paths that are too long. Some classical CDs have enormously long track names which which can create problems when you rip them. I seem to remember Windows lets you create files with path names longer than 255, but doesn't let you access them. It's worth keeping well clear of the 255 to avoid problems with some backup software. I used dBpoweramp to do most of my ripping; once I'd fallen over the long pathname issue it was easy enough to truncate the pathname automatically when necessary.
Logged

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #15 on: December 18, 2015, 01:21:06 am »

Thanks Glynor. I actually discovered the Details button before I read your post, but got too busy to let you know before now. There are now 55 too-long files. Is there any way I can correct them as a group or maybe subgroup, such as each album, or whether I have to look at them one by one and just delete some part of each one until they are short enough?
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: File Name Too Long
« Reply #16 on: December 18, 2015, 03:49:36 am »

Thanks Glynor. I actually discovered the Details button before I read your post, but got too busy to let you know before now. There are now 55 too-long files. Is there any way I can correct them as a group or maybe subgroup, such as each album, or whether I have to look at them one by one and just delete some part of each one until they are short enough?
If you can reduce the number of characters in the path rather than the filename part, yes you can. 

Inside of JRiver select the album and in the tag window shorten the path itself for the album ... however this is usually only when people are not economical in how they physically file their albums .. like adding genres and such ... otherwise you are going to have to do change the filename itself individually.... I find it easier to do this from the tag window as other wise you might need to redoo an auto import  to fix external changes. If you already have simple paths like Artist/Album as normally you should .. not much you can do to reduce the number of characters, though other than shortening the Album Name maybe..

Library tools like replace can't operate directly on the filename field or filepathfield if i remember correctly. There are utilities that can truncate/reduce the filename, but they might lop off the important part of the name. You could use something like TagScanner and set up a mask to do this in bulk and preview it first -- I use this a lot when I purchase digital music to rename everything ... it very good and can be done post-rip http://www.xdlab.ru/en/. I also use the utility that Andy U posted everytime I rip classical music, as part of my work flow
Logged

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #17 on: December 18, 2015, 01:37:11 pm »

Thanks Arindelle. I've been using your naming conventions when ripping, but I'm not sure if these too-long files are from before or after I started using them. Perhaps you can tell by looking at them. If you want to look at the list, go to Dropbox link at https: //www.dropbox.com/s/q85ec6jl69bnzar/FILE%20NAMES%20TOO%20LONG.docx?dl=0 .

Since JRiver refused to import them, I can't look at the tag window to shorten the path. But as a path example of a recently ripped CD that wasn't too long, I see under Filename (path): \\JVDISKSTATION\music\BK FLAC FOR JV\Jordi Savall\Captaine Tobias Hume; Musicall Humors\  In your opinion, is this a reasonably short path?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #18 on: December 18, 2015, 02:30:12 pm »

For any of them that are too long, the easiest thing to do would probably be:

1. Move the files to a "temp" folder in the root of your file share, or even on a local disk, like C:\temp\.
2. Then, this will probably shorten the path enough so that they can import. If they still won't import, you might have to shorten the actual file names, or remove wacky characters, but just moving them to a temp folder at the root will probably be enough.
3. From there, use RMCF to apply a proper path and filename structure to the files. RMCF won't let you exceed the path length limits, so you don't really have to worry about it.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #19 on: December 18, 2015, 03:06:15 pm »

Thank you Glynor. Since the files will ultimately have to live on the NAS in my client's home, my plan would be to move them to my laptop C drive, apply RMCF to shorten the path/filename and then move them back to the NAS. Will RMCF allow me to name the NAS drive rather than the C drive where the files are temporarily located?

Please send me a Wiki link where using RMCF is explained in detail.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: File Name Too Long
« Reply #20 on: December 18, 2015, 05:42:26 pm »

The wiki link is in my post above. Click on it.

And, yes, you can rename directly to any accessible filesystem location, including UNC paths (eg \\servername\sharename\path\to\files.flac).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #21 on: December 19, 2015, 04:15:21 am »

Oops! I should have realized blue meant link. I thought you were just highlighting the text. Thanks.
Logged

tuneup

  • Galactic Citizen
  • ****
  • Posts: 281
Re: File Name Too Long
« Reply #22 on: December 19, 2015, 06:00:26 pm »

Since I still have most of the albums with too-long file names, I found it easier to just delete the album from the NAS and then re-rip it with a file name that was more compact. The others I will have to shorten the file names.

Interestingly, I ran another auto-import of the same library (before any re-ripping) and while it still came up with 55 overlong files names, some of them were from different CDs than on the previous import. I had not, at least consciously, changed the file names on any of them so I have no idea why this happened and why the import included files that it previously said were overlong. But I am going to re-rip anything borderline that came up on either list to prevent them from being rejected in a future import.
Logged
Pages: [1]   Go Up