Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This should never happen FIXME! solution for macOS #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Dirlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,23 @@ Dirlist::handlepossiblefile(const std::string& possiblefile, int recursionlevel)

if (S_ISDIR(info.st_mode)) {
std::cerr << "Dirlist.cc::handlepossiblefile: This should never happen. "
"FIXME! details on the next row:\n";
"FIXME! details on the next rows:\n";
std::cerr << "possiblefile=\"" << possiblefile << "\"\n";
DIR* dirp = opendir(possiblefile.c_str());
if (dirp == nullptr) {
std::cerr << "File seems to be a directory, but opendir() returned error: " << strerror(errno) << std::endl;
#ifdef __APPLE__
if (errno == EPERM) {
std::cerr << "This could be due to Full Disk Access not being "
"granted to the terminal running rdfind" << std::endl;
std::cerr << "You can grant Full Disk Access to your terminal in "
"System Preferences -> Security & Privacy -> Privacy -> "
"Full Disk Access" << std::endl;
}
#endif
} else {
std::cerr << "opendir() succeeded on the second try. Was this changed while we were reading it?!" << std::endl;
}
// this should never happen, because this function is only to be called
// for items that can not be opened with opendir.
// maybe it happens if someone else is changing the file while we
Expand Down