Re: Linux named pipes programming problem

Discussion in 'C Programming' started by Joe Estock, Dec 13, 2005.

  1. Joe Estock

    Joe Estock Guest

    wrote:
    > Hi all,
    >
    > I'm new to the group and am seeking your advice on my Linux programming
    > problem.


    Solution: comp.linux.programmer. This is comp.lang.c where we discuss on
    ly the c standard and conforming c code.

    >
    > Two programs are involved. One is myProgram.cc, which reads user's
    > input from keyboard and prints output to the screen. The other program
    > is main.cc, which wants to communicate with myProgram in real time
    > using input/output redirection and two named pipes.


    ..cc is the typical extension for c++ programs which is not covered here.
    Try comp.lang.c++.

    >
    > Now the problem is that main.cc works fine in one machine (sun4u, OS
    > version 5.9, sparc, Ultra-60) but hangs in another machine running
    > Debian Linux--the execution falls into infinite waiting at the first
    > std::getline statement in main.cc. Could anyone suggest what the
    > problem might be? The two programs are as follows:


    Sounds like a system-specific pitfall. Try a nesgroup dedicated to your
    particular platform/language.

    [snip c++ source code]

    > The above program main.cc falls into infinite waiting at the first
    > std::getline statement when running on Debian Linux. However, if I
    > remove the "//" in Line A and Line B in main.cc, it will work fine. But
    > this solution is not what I want because it performs one-off write to
    > the pipe file rather than real time interactive write and read.
    >
    > Thanks very much for any suggestion from you!
    > George
    >


    If you have any questions regarding c or the c standard, feel free to
    ask them here. C++, linux, and any platform specific extensions are OT
    for comp.lang.c.

    Joe
     
    Joe Estock, Dec 13, 2005
    #1
    1. Advertising

  2. Joe Estock

    Guest

    Thanks Joe!
    -George
     
    , Dec 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. piyush
    Replies:
    0
    Views:
    1,862
    piyush
    Jul 14, 2004
  2. Replies:
    0
    Views:
    503
  3. Tomek

    Python and named pipes problem

    Tomek, Feb 26, 2008, in forum: Python
    Replies:
    0
    Views:
    499
    Tomek
    Feb 26, 2008
  4. Replies:
    17
    Views:
    4,753
    CBFalconer
    Jan 13, 2009
  5. Phil Tomson

    Bidirectional named pipes on Linux

    Phil Tomson, Jun 16, 2004, in forum: Ruby
    Replies:
    11
    Views:
    1,105
    John Carter
    Jun 17, 2004
Loading...

Share This Page