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
On 06/02/2023 06:27, Stephane Chazelas wrote:
On 2023-02-05 20:59, Paul Eggert wrote:
On 2023-02-05 11:59, Pádraig Brady wrote:
[...]
Let's leave that as-is, please. If 'wc' can output the correct value
without reading its input, POSIX does not require 'wc' to do the read,
and it seems
On 2023-02-05 20:59, Paul Eggert wrote:
On 2023-02-05 11:59, Pádraig Brady wrote:
[...]
Let's leave that as-is, please. If 'wc' can output the correct value
without reading its input, POSIX does not require 'wc' to do the read,
and it seems perverse to modify 'wc' to go to the effort to refuse
On 2023-02-05 11:59, Pádraig Brady wrote:
Hopefully the attached addresses this.
Thanks for fixing that.
Note it doesn't add the constraint on the input being readable,
which I'll think a bit more about.
Let's leave that as-is, please. If 'wc' can output the correct value
without reading
On 05/02/2023 18:27, Stephane Chazelas wrote:
"wc -c" without filename arguments is meant to read stdin til
EOF and report the number of bytes it has read.
When stdin is on a regular file, GNU wc has that optimisation
whereby it skips the reading, does a pos = lseek(0,0,SEEK_CUR)
to find out
"wc -c" without filename arguments is meant to read stdin til
EOF and report the number of bytes it has read.
When stdin is on a regular file, GNU wc has that optimisation
whereby it skips the reading, does a pos = lseek(0,0,SEEK_CUR)
to find out its current position within the file, fstat(0) and