bug-coreutils
[Top][All Lists]
Advanced

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

Re: merge sort temporary files


From: Charlie Gordon
Subject: Re: merge sort temporary files
Date: Sat, 15 May 2004 01:17:43 +0200

>
> Sorry, that wouldn't work, for two reasons.  First, the two processes
> are running in parallel so it doesn't solve the problem in general.
> For example, in:
>
> cat F G | sort -m -o G - H
>
> if "sort" doesn't make a copy of all its input first, it'd quite
> possible for sort to unlink G and open G for writing before cat opens
> G for reading.
>
you are such a master mind !

> Second, POSIX doesn't allow it.  With a few exceptions (and this isn't
> one of them), POSIX requires that output files be opened only with
> "open"; you're not allowed to unlink first.  Here are the general rules:
>
>
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag
_01_07_01_04>

I knew there was some major reason not to do this, thank you for
enlightening my day.

Chqrlie.








reply via email to

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