bug-coreutils
[Top][All Lists]
Advanced

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

Re: merge sort temp files


From: stan-bugcoreutils
Subject: Re: merge sort temp files
Date: Fri, 30 Jul 2004 17:30:23 -0700 (PDT)

On Fri, 30 Jul 2004, Paul Eggert wrote:

> address@hidden writes:
>
> > Would it be safe to put in a check that says if stdout is the output, that
> > it could safely not create temp files?
>
> I don't think so.  Consider the following somewhat-contrived example:
>
> sort -m -o - f1 f2 1<>f1
>
> Here standard output points to the start of the regular file "f1".
> If "sort" doesn't copy f1 before writing to standard output, it
> will trash its input before reading it.

Yes, you're right of course.  I hadn't thought of that.

> Could you please try the following patch instead?  If it solves your
> problem, we're done, as it has already been installed in CVS
> coreutils.  If not, I'd like to know more about your problem, e.g., a
> test case.  Thanks.
>
> http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00076.html

This is exactly what I need actually.  I was trying to think of a patch
would still allow for the STDIN check.  My apologies for not looking more
thoroughly through the mailing lists.  I missed that thread.

Thanks for your help.

Stan




reply via email to

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