Hi Paul,
In the particular case of GNU ed, the diagnotic is actually reported
by the `getc' function of GNU libc. It's their fault!
For what it's worth, GNU sed and awk provide a similar diagnostic:
$ sed -e 1q .
sed: read error on .: Is a directory
$ gawk 'END { print "hello, world!" }' .
gawk: warning: command line argument `.' is a directory: skipped
hello, world!
$
Note that "EISDIR - Is a directory." is included among the POSIX list
of system error numbers and messages:
<https://pubs.opengroup.org/onlinepubs/9799919799/>
The One True Awk evidently discards directory arguments without any
diagnostic, as do Solaris implementations of sed and ed:
omnios$ awk 'BEGIN { getline } END { print }' .
omnios$ sed -e 1q .
omnios$ printf '%s\n' q | ed .
0
omnios$
If it's a question of breaking portability of scripts that parse
diagnostics, then perhaps the Solaris approach of discarding directory
arguments is the more appropriate behavior?
Thanks for the bug report. Forwarding it to <[email protected]>, and
closing the coreutils bug.
-------- Forwarded Message --------
Subject: bug#80158: incorrect diagnostic from ed
Date: Thu, 8 Jan 2026 17:21:01 -0500
From: Douglas McIlroy
To: [email protected]
Bug exhibited by ed version 1.22.2:
If FILE is not a directory, the shell command
ed FILE/
yields an incorrect diagnostic, "Is a directory".
Most, if not all, other utilities yield "No such file or directory".