bug-coreutils
[Top][All Lists]
Advanced

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

bug#61300: wc -c doesn't advance stdin position when it's a regular file


From: Paul Eggert
Subject: bug#61300: wc -c doesn't advance stdin position when it's a regular file
Date: Mon, 6 Feb 2023 11:50:37 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 2/6/23 11:38, Pádraig Brady wrote:
Note also if you really want to read, you can always `cat | wc -c`
rather than just `wc -c`

Even that's not guaranteed, as 'cat' is not required to use the 'read' system call if it can determine that the standard input contains only NULs without calling 'read'. (GNU 'cat' doesn't do this, but POSIX allows it.)

We shouldn't complicate 'wc' (thus slowing it down and worse, possibly introducing a bug) if the only goal is to make 'wc' fail more often in implausible scenarios.





reply via email to

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