c++ How to check if there is a file in a directory quick way? -
what trying when directory has no write permission , if directory contains @ least 1 file trying print out "permission denied"
dir *dir; dir = opendir (argv[i]); if (!(sb.st_mode & s_iwusr) && (readdir(dir) != null)) {     printf("rm: cannot remove ");     printf(argv[i]);     printf(": permission denied\n");  }   this trying do, prints out messages when there no files... suggestions?
 
 
Comments
Post a Comment