From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15601 invoked by alias); 8 Nov 2007 23:51:57 -0000 Received: (qmail 15499 invoked by uid 48); 8 Nov 2007 23:51:23 -0000 Date: Thu, 08 Nov 2007 23:51:00 -0000 Message-ID: <20071108235123.15498.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/33863] backspace error on i386-pc-mingw32 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00756.txt.bz2 ------- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-11-08 23:51 ------- (In reply to comment #7) > However, most run time > libraries do the simple thing when they see io-redirection - they close the > stream file and re-open it as a ordinary file. Is there any reason GFORTRAN > could not do that ? As a generic answer: I don't think it's advisable as it's against the principle of least surprise. I can think of at least a standard case where this could fail: you create a file, run a Fortran program with stdin redirected to that file, and unlink the file (so that, when the Fortran program exits, the file is removed without you having to wait and do it later). In that case, trying to reopen it will fail (it might even give wrong results if a new file of the same name is created, though it's not likely). This "unlink" trick is widely used. For example, my shell (zsh) does it to avoid you creating temporary files: instead of letting you do: $ ./foo > tmp $ ./bar < tmp you can do $ ./bar =(./foo) (and yes, you could use a pipe, but it's not the same if tmp is large and you don't want the two programs to run concurrently). Well, I really am verbose tonight, but I don't think it's desirable. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33863