[Top][All Lists]

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

[bug-diffutils] bug#17075: bug#17075: diff - - exits immediately

From: Paul Eggert
Subject: [bug-diffutils] bug#17075: bug#17075: diff - - exits immediately
Date: Mon, 24 Mar 2014 17:06:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Karl Berry wrote:
Couldn't there be side effects missed by not reading the input?

Sure, but the invoker shouldn't rely on those side effects, from 'diff' or from 'cmp' or from 'head' or from any other program that need not read all its input.

Perhaps the help message could get a one-line addition:

Unfortunately all the one-liners I can think of are wrong. For example, diff must read all its input even when given two identical file names A and A, e.g., if it's also given the -DFOO option. And even without -DFOO, 'diff A A' reports an error if A does not exist.

Another amusing example: 'diff A A' can succeed even if A is unreadable:

$ umask 777
$ echo foo >A
$ ls -l A
---------- 1 eggert eggert 4 Mar 24 17:02 A
$ diff A A
$ echo $?

reply via email to

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