Andrew McGill wrote:

> Bash Version: 3.2
> Patch Level: 39
> Release Status: release
> 
> Description:
>       redirection using ">" creates a file descriptor without O_APPEND.  When
>       processes write simultanteously to this file, unnecessary data 
> corruption
>       occurs.

Output redirection has never used O_APPEND.  That's the difference between
`>' and `>>'.  If processes write simultaneously to any file, there is the
potential for overwriting and corruption depending on how the writes are
scheduled.  The usual fix is to adopt some ordering convention internal to
the application.

If you want to force append mode, you need to use `>>'.  That's why it
exists.

> Fix:
>       The fix is to include O_APPEND with O_CREAT when creating a file to
>       receive an output stream.  This has the minor side effect of making the 
>       output fd non-seekable.

I think you underestimate the impact of the "minor side effect".  The
status quo is the way things have existed for many years.  You don't know
the number of applications that expect to be able to seek in their output
stream if they detect it is a regular file.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


Reply via email to