Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Filename Character Limit?

I have searched the help files for an answer to this question and haven't found the answer.

Is there a limit to the number of characters that a file name can have? If so, what's the limit?

Thanks for your help!

Connie

Posted on Oct 29, 2005 9:40 PM

Reply
10 replies

Oct 30, 2005 7:55 PM in response to Connie Porcher

Most parts of OS X are also limited when it comes to the overall length of the file path. The path limitation, "PATH_MAX", is 1,024 bytes, which in most cases means 1,024 characters. (That's based on 1 byte for each character, though Asian characters may require more bytes to represent them).

Under most circumstances, you won't ever run into this limit, but when you do, you'll get unexpected behavior in the Finder. For example, not being able to move files and folders out of the folder in question.

Most applications will allow you to use up to 255 characters in the filename, but certain Carbon software that uses the older FSSpecs (a way to refer to a file) will be limited to 31 characters.

Anyway, hope this helps....

Oct 31, 2005 9:55 AM in response to Courcoul

slash or colon are disallowed, but not both (techincally; doesn't mean a programmer may have a reason to prohibit both or may do so without understanding that it isn't necessary). Slash is the unix delimiter, colon is the (legacy) Mac one. Mac interfaces automatically map the "legal character" and the "path delimiter" entities correctly. For example, one can create a folder in the Finder named "foo/bar" but not "foo:bar"; the result will be a directory named "foo:bar" for Unixy things.

Nov 3, 2005 1:44 AM in response to Courcoul

In my experience, it's the true-Unix apps (or Mac apps that spawn shell scripts under-the-hood) that are more likely to mishandle filenames with spaces. The Mac world has always had spaces in filenames and its programmer tools are well aware of that. Spaces are pretty rare in the unix world, though, so it's easy for unix folks to forget to quote them properly. Regardless, it's always a bit of a risk, and much more-so if you're passing files between different apps or different machines.

Filename Character Limit?

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