bug-bash
[Top][All Lists]
Advanced

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

Re: fd leak with {fd}>


From: Chet Ramey
Subject: Re: fd leak with {fd}>
Date: Sat, 01 Dec 2012 15:33:34 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

On 12/1/12 1:00 AM, Dan Douglas wrote:

> 
> I believe one of the motivations for named FDs other than automatic FD 
> allocation, and the reason they remain open, was probably to deal with 
> organizing and grouping coprocesses so that you could follow the variable 
> names rather than the FDs directly due to the somewhat awkward way they are 
> manipulated.

That's a good point.  I think that the general idea is to expose
abstractions that are closer to the underlying OS -- which, face it,
is Unix -- model.  That's part of the idea behind the COPROC array,
which is close to the pipe(2) model.

The other issue, which I'm surprised nobody has mentioned so far, is
that this is the only way ksh allows programmers to use file descriptors
greater than 9.  That's never been an issue for bash: it has always
allowed multi-digit file descriptor specifications.  ksh has maintained
30+ years of backwards compatibility and only allows redirections to
specify file descriptors 0-9.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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