[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fd leak with {fd}>
From: |
Pierre Gaston |
Subject: |
Re: fd leak with {fd}> |
Date: |
Fri, 23 Nov 2012 09:04:30 +0200 |
On Thu, Nov 22, 2012 at 9:15 PM, Chet Ramey <chet.ramey@case.edu> wrote:
> On 11/16/12 10:47 AM, Sam Liddicott wrote:
> > Repeated executions of: { echo $fd ; } {fd}> /dev/null
> > will emit different numbers, indicating that fd is not closed when the
> > block completes.
>
> This is intentional. Having been given a handle to the file descriptor,
> the shell programmer is assumed to be able to manage it himself.
>
>
It seems rather counter intuitive that the fd is not closed after leaving
the block.
With the normal redirection the fd is only available inside the block
$ { : ;} 3>&1;echo bar >&3
-bash: 3: Bad file descriptor
if 3 is closed why should I expect {fd} to be still open?
- fd leak with {fd}>, Sam Liddicott, 2012/11/16
- Re: fd leak with {fd}>, Chet Ramey, 2012/11/22
- Re: fd leak with {fd}>, Sam Liddicott, 2012/11/22
- Re: fd leak with {fd}>,
Pierre Gaston <=
- Re: fd leak with {fd}>, Chet Ramey, 2012/11/26
- Re: fd leak with {fd}>, Pierre Gaston, 2012/11/26
- Re: fd leak with {fd}>, Pierre Gaston, 2012/11/26
- Re: fd leak with {fd}>, Sam Liddicott, 2012/11/26
- Re: fd leak with {fd}>, Chet Ramey, 2012/11/26
- Re: fd leak with {fd}>, Sam Liddicott, 2012/11/26
- Re: fd leak with {fd}>, Chet Ramey, 2012/11/26
- Re: fd leak with {fd}>, Chris F.A. Johnson, 2012/11/26
- Re: fd leak with {fd}>, Dennis Williamson, 2012/11/26
- Re: fd leak with {fd}>, Chet Ramey, 2012/11/26