bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort feature requests


From: Eric Blake
Subject: Re: sort feature requests
Date: Mon, 30 Jul 2007 21:44:22 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Matthew Woehlke <mw_triad <at> users.sourceforge.net> writes:

> Maybe I am being brain-dead... This does not work with 6.9:
> 
> $ seq 5 | ( head -1 ; sort -n )
> 
> ...but now I forget if pipes are seekable (I want to say "no" actually), 
> so maybe PEBKAC?

Pipes are not seekable, hence the name ESPIPE for the error that lseek sets on 
nonseekable files.  POSIX is clear that trying to share input pipes across 
multiple processes has undefined behavior (about the only exception is when 
there is an additional explicit requirement, such as the one on sh, to read 
stdin unbuffered so that it never consumes too much input even when stdin is a 
pipe).

> 
> Works fine if the input is a file.
> 

Good.  But note that coreutils 6.9 (Mar 22) predates the gnulib fflush/fseek 
changes (first started in Apr).

-- 
Eric Blake






reply via email to

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