Date: Wed, 28 Feb 2001 13:28:17 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Stromberg cc: djgpp-workers AT delorie DOT com Subject: Re: FD 4 special for DJGPP (and Perl in particular)? In-Reply-To: <200102281109.MAA06814@lws256.lu.erisoft.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 28 Feb 101, Martin Stromberg wrote: > > However, the > > exec 4>&1 > > causes the following error: > > redirection error: Bad file descriptor (EBADF) > > > > Only fd 4 seems to be affected. > > Doesn't *DOZE have five predefined fds: stdin, stdout, stderr, AUX and > PRN (not sure about the order of the last two). It does; but so what? A redirection such as above calls dup2(1, 4). dup2 should close the previous handle 4, if it was open, before it redirects it to handle 1. Anyway, if your theory is correct, the same proble, should happen with handle 3. Does it?