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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -