- 论坛徽章:
- 0
|
I would like to know which file do I need to include to get NAME_MAX? I'm
trying to read filenames of a directory but it gave me error saying that
the NAME_MAX is undefined. I've looked into the /usr/include directory and
I see that it's not defined anywhere.
but, I write the programe
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
int main(int argc, char* argv[])
{
printf("Max path is %d\n", PATH_MAX);
printf("File max is %d\n", NAME_MAX);
return 0;
}
# gcc -o name namemax.c
# ./name
Max path is 4095
File max is 255
it works.
but I can't find PATH_MAX and NAME_MAX in the "dirent.h"
please help me, guys |
|