X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Mon, 28 Jan 2002 12:29:04 +0100 From: Laszlo Molnar To: DJGPP Workers List Subject: redirection problem with perl Message-ID: <20020128122904.R5722@libra.eth.ericsson.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i Reply-To: djgpp-workers AT delorie DOT com Hi Folks, Finally I've found the cause of the redirection failures with perl that I've reported some weeks ago. The problem is that perl duplicates a stream like this: old_h = fileno(old_stream) old_mode = fcntl(old_h, F_GETFL) new_stream = fdopen(dup(old_h), mode_to_string(old_mode)) This fails because this fcntl call always returns 0, which means fdopen is always called with "r" as the mode. Any idea to work around this? Thanks, Laszlo