What is the maximum number of characters for file name on one side and for pathname on the other on macOS?

What is the maximum number of characters for file name on one side, and for pathname on the other, on macOS?


Any difference for such both parameters between Hierarchical File System Plus (HFS Plus, HFS+, Mac OS Extended or HFS Extended) in macOS 10.12 Sierra and older versus Apple File System (APFS) in macOS 10.13 High Sierra and newer?


Thanks.

iMac with Retina 5K display, macOS Sierra (10.12.6), Booting from internal Apple SSD 2TB

Posted on Sep 23, 2017 4:27 AM

Reply
2 replies

Sep 23, 2017 7:13 AM in response to ApMaX

According to Wikipedia the limit for file names is the same - 255 Unicode UTF-16 characters.


For pathname length there is supposed to be no limit. However, the Finder seems to have a bit of trouble when going over 1024; and in the shell the pwd command says something like “name too long” for paths over 1024 characters.

Mind you, I had no trouble creating those directories deep down and with long paths, and I could cd up and down - just handling the path as a whole caused difficulties.


To note - this not a limitation of the file system.

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.

What is the maximum number of characters for file name on one side and for pathname on the other on macOS?

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