filenames too long, how do I find them?

I have lots of filenames in my archive which are too long. How can I find them all so that I can fix them?

Thanks

MacBook Pro, Mac OS X (10.1.x)

Posted on Feb 17, 2017 2:02 PM

Reply
8 replies

Feb 18, 2017 9:45 AM in response to nick.fazio

As per this article : macOS Sierra: Show or hide filename extensions

A filename extension appears at the end of some filenames, and looks like a period followed by a few letters or words (for example, .jpg). A file’s filename extension shows what type of file it is and what apps can open it.

Filename extensions are usually hidden in macOS, but if you find them useful, you can show them. If extensions are hidden, macOS still opens files with the proper apps.

For all files

  1. Choose Finder > Preferences, then click Advanced.
  2. Select “Show all filename extensions.”

Feb 20, 2017 3:48 AM in response to nick.fazio

Pydio appears to be an open source file collaboration system probably somewhat along the lines of Microsoft SharePoint.


The Mac operating system has support for effectively unlimited file name and file path lengths. Unfortunately Windows has a limit of only 260 characters for its maximum file path. See https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.a spx?f=255&MSPPError=-2147217396


Note: In theory you can now use file paths of 32,767 characters in Windows however programs have to be re-written to take advantage of this and even Microsoft's own programs often have not. As a result for the majority of cases you do still have a 260 character limit.


Note: It is the file path length rather than the file name length that is the real problem, one very long file name might be ok but several shorter file names making a total longer than 260 characters would not.


What is really annoying is that Microsoft Office for Mac even though it is running on a Mac which can support much

longer file paths also chokes if you use longer file paths. Clearly Microsoft are artificially crippling the Mac version of Office to match the limitation of the Windows version.


In this case I suggest you are going to need to write a script. The following prints the length and then the file path recursively.


find . | perl -l -pe 'print length'


This might be a starting point. You could then search the result in another command for numbers greater than the danger level.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

filenames too long, how do I find them?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.