11 int main()
 12 {
 13         char path1[BUFSIZE];
 14         ssize_t nread;
 15         DIR *fp;
 16         struct dirent *item;
 17         int fdin;
 18         int count = 0;
 19         const char *path;
 20
 21         fp = opendir("/home/khs/week5_22");
 22         if(fp != NULL){
 23                 for(;;)
 24                 {
 25                 item = readdir(fp);
 26                 path = readdir(fp);  //권한 변경을 시도하려고 만든 부분
 27                
 28                 if (item != NULL){
 29                         chmod(path, 777); // 권한 변경을 시도한 부분.
 30                         printf("succed to change the mode");
 31                        
 32                 }//else if (S_ISDIR(fp->st_mode)){
 33                 //      printf("Fail to change the mode");
 34                 //}
 35
 36                 if (item == NULL){
 37                         break;
 38                 }      
 39                 printf("%s\t",item->d_name);
 40                 count +=1;
 41                 if(count%2 == 0)
 42                         printf("\n");
 43         }              
 44         closedir(fp);  
 45         printf("\n");  
 46
 47
 48
 49         }
 50 }
//체크 한 부분에서 오류가 나거든여 chomd형식이 chmod(const char * , mode_t mode) 라고 해서 const char *path 만둘어서 받았는데 , path = readdir(fp);는 또 안되던군요 어떻게 해야하죠?