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.
Asked
Active
Viewed 984 times
1
-
Answer is compiler dependent. What compiler are you using? – chux - Reinstate Monica May 09 '20 at 07:40
-
1@chux-ReinstateMonica gcc ANSI C 90 – avivgood2 May 09 '20 at 08:00
-
[Where is PATH_MAX defined in Linux?](https://stackoverflow.com/a/56385296/24103599) may be useful. – chux - Reinstate Monica May 09 '20 at 08:03
1 Answers
2
It should be NAME_MAX defined in <limits.h>
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
-
-
yeah usually it's on Linux system, not sure if it's also the same for Windows or MacOS – artm May 09 '20 at 06:42
-
@avivgood2 Yes, implementation-defined is a good as it gets. It means the implementation must provide a document stating the value (and limits.h contents may be enough for that). NAME_MAX is not constant across the universe, as say, the speed of light. :-) – Jens May 09 '20 at 10:59