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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -