From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4947 invoked by alias); 1 Mar 2002 10:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4850 invoked by uid 71); 1 Mar 2002 10:56:01 -0000 Resent-Date: 1 Mar 2002 10:56:01 -0000 Resent-Message-ID: <20020301105601.4849.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, benko@sztaki.hu Received:(qmail 23588 invoked by uid 61); 1 Mar 2002 10:50:10 -0000 Message-Id:<20020301105010.23585.qmail@sources.redhat.com> Date: Fri, 01 Mar 2002 02:56:00 -0000 From: benko@sztaki.hu Reply-To: benko@sztaki.hu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/5799: streams reading from fifo X-SW-Source: 2002-03/txt/msg00002.txt.bz2 List-Id: >Number: 5799 >Category: libstdc++ >Synopsis: streams reading from fifo >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Mar 01 02:56:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Benko Pal >Release: 3.0.4 >Organization: >Environment: SuSE linux 7.3 i686 libc 2.2.4 >Description: Perhaps this is not a bug. if an ifstream reads from a named pipe, it sees the data only when the buffer is full or the pipe is closed, but not when the process writing to the pipe flushes. Using there is no such problem. e.g. compiling and running #include #include int main() { std::ifstream in("/tmp/pipe"); char c; while (in >> c) std::cout << c; return 0; } while in an other shell I $ mkfifo /tmp/pipe $ cat > /tmp/pipe hello world ^D $ In the shell running the c++ program helloworld only appears after ^D. But compiling and running #include int main() { FILE *in = fopen("/tmp/pipe", "r"); char c; while ((c = fgetc(in)) != EOF) putchar(c); return 0; } After entering hello and pushing enter, hello appears on the output of the program. Is a special initialisation of the ifstream needed perhaps? >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: