Search code examples
cfilelimitfilepathansi-c

Getting system's max allowed path length in c


How can I determine the maximum file path length allowed in the system my program is running on? Is it in limits.h? because I didn't find it there.


Solution

  • It should be NAME_MAX defined in <limits.h>

    https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html