Stepan Kasal <[EMAIL PROTECTED]> writes:

> So if the fact that the file is a directory was the reason why the OS
> refused to read it, that fact is not reported.

> So now I understand that the current behaviour is good.

No, it's not good, because the behavior doesn't conform to POSIX.
POSIX requires a diagnostic, and requires that the exit status must be
greater than 1.  Here's why:

http://www.opengroup.org/onlinepubs/007904975/utilities/xcu_chap01.html#tag_01_07_01_07

says that grep must get the contents of the file by the equivalent of
open () followed by successive read () calls.

http://www.opengroup.org/onlinepubs/007904975/utilities/xcu_chap01.html#tag_01_11
(under CONSEQUENCES OF ERRORS) says that if the requested operation
(in this case a "read") can't be done, the utility shall issue
a diagnostic and exit with error status.


So I would change the text to this:

        [...] `read', which means that `grep' attempts to read the
        directory just as if it was an ordinary file.  Many operating
        systems and filesystems disallow this, which causes `grep' to
        report an error and go on to the next input file.


_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to