open dir return null and i don't now why .
the code is :
and the output is :Code:int main(){ char buff[1000]; strcpy(buff,"."); lsFunc(buff); } void lsFunc(char* toSend){ void* myDir; struct dirent* ent; if(!strcmp(toSend,"")) myDir=opendir("."); else myDir=opendir("toSend"); perror(NULL); printf("%d\n",errno); }
"No such file or directory
2
Segmentation fault"
Thank you for your help
eyal