Index: src/files.c =================================================================== --- src/files.c (revision 5574) +++ src/files.c (working copy) @@ -38,17 +38,33 @@ { char *parentdir; struct stat parentinfo; - bool validity = TRUE; + bool validity = FALSE; if (strrchr(filename, '/') == NULL) parentdir = mallocstrcpy(NULL, "."); else parentdir = dirname(mallocstrcpy(NULL, filename)); - if (stat(parentdir, &parentinfo) == -1 || !S_ISDIR(parentinfo.st_mode)) { - statusbar(_("Directory '%s' does not exist"), parentdir); - validity = FALSE; + if (stat(parentdir, &parentinfo) == -1) { + if (errno == ENOENT) + statusbar(_("Path '%s' does not exist"), parentdir); + else + statusbar(_("Path '%s': %s"), parentdir, strerror(errno)); beep(); + } else if (!S_ISDIR(parentinfo.st_mode)) { + statusbar(_("Path '%s' is not a directory"), parentdir); + beep(); + } else { + char *inthedir = mallocstrncpy(NULL, parentdir, strlen(parentdir) + 3); + strcat(inthedir, "/."); + + if (stat(inthedir, &parentinfo) != -1) + validity = TRUE; + else { + statusbar(_("Path '%s' is not accessible"), parentdir); + beep(); + } + free(inthedir); } free(parentdir);