If invoking 'M-x dired' and an error is encountered opening a directory, mg isn't very helpful. Though it will display a message on an EACCES problem. This diff doesn't go into the specifcs of which other error access(2) has encountered but does display an error msg:

"Error opening: /non/existant/dir/"

ok?

Index: dired.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.97
diff -u -p -u -p -r1.97 dired.c
--- dired.c     1 Mar 2021 10:51:14 -0000       1.97
+++ dired.c     1 Mar 2021 13:26:49 -0000
@@ -243,7 +243,7 @@ dired(int f, int n)
                        dname[0] = '\0';
        }

-       if ((bufp = eread("Dired: ", dname, NFILEN,
+       if ((bufp = eread("Dired (directory): ", dname, NFILEN,
            EFDEF | EFNEW | EFCR)) == NULL)
                return (ABORT);
        if (bufp[0] == '\0')
@@ -928,6 +928,9 @@ dired_(char *dname)
                if (errno == EACCES) {
                        dobeep();
                        ewprintf("Permission denied: %s", dname);
+               } else {
+                       dobeep();
+                       ewprintf("Error opening: %s", dname);
                }
                return (NULL);
        }

Reply via email to