views:

282

answers:

2

I'm trying to find a definitive answer (e.g. Apple developer documentation) for the maximum length of a complete path string on Mac OS X. I've seen various non-authoritative sites that state that it is unbounded, 4096 characters, or 1024 characters, but haven't been able to find an answer on Apple's web site.

+1  A: 

If you look in /usr/include/sys/syslimits.h on a Leopard system, you'll see:

#define PATH_MAX                 1024   /* max bytes in pathname */

Furthermore, Technical Note 1150: HFS Plus Volume Format, in discussing symbolic links, says:

"For maximum compatibility, the length of the path should be 1024 bytes or less."

peterb
+2  A: 

You might find this useful: http://rentzsch.com/macosx/pathmaxBlackholing

1024 bytes is correct.

dorianj