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