Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X Lion: What is the max path length?

I am having trouble finding this information, and trial and error is telling me that the value is very high. I figured I would ask the community to see if anyone knows and can point me to an apple page that confirms the length for Lion. All I know is it is larger that Snow Leopard.

like image 930
Rodney S. Foley Avatar asked Aug 21 '11 19:08

Rodney S. Foley


1 Answers

Old, but I found an answer:

#include <sys/syslimits.h>

and then it'll have a PATH_MAX constant as a #define. In my case,

char filenameBuffer [PATH_MAX];

You could hardcode 1024 as the maximum path, but using a constant like that makes your code scalable with new releases

like image 156
Joe Plante Avatar answered Oct 06 '22 11:10

Joe Plante