[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] [HEY TOM!] unhelpful error for unreadable directori

From: Tom Lord
Subject: Re: [Gnu-arch-users] [HEY TOM!] unhelpful error for unreadable directories
Date: Sun, 25 Apr 2004 22:37:48 -0700 (PDT)

    > From: Aaron Bentley <address@hidden>

    > I think it's really wierd that when the problem is an unsearchable 
    > directory named foo, users will get an error message about a 
    > non-existant directory named foo/{arch}.  

The message they'll get will be about not having permission to access
whatever (if anything) is named by "foo/{arch}".   

That's just unix.  `cat' behaves the same way:

        % mkdir foo
        % chmod ugo-rwx foo
        % cat foo/blah
        cat: foo/blah: Permission denied

    >>> One way to address the problem would be to put a test for
    >>> readability before the stat.  That would be a pessimization, but
    >>> it would have the same behaviour as doing the test after the
    >>> stat if the stat failed.

    > Yeah.  That was meant to prove that doing it afterwards was
    > okay, since the only difference between doing it beforehand and
    > doing it afterwards was that doing it afterwards was faster.

Ah.  Well, I pointed out why it proves no such thing.

    > How about this:

    > "Error encountered checking for nested project trees in %s:\n%s
    > accessing %s\n", directory, errno_to_string (errn), file);

That error message is misleading to experts.  How about:

        Error checking for existence of: foo/{arch}
         (from lstat): Permission denied (13)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]