Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Linux named pipes programming problem

Reply
Thread Tools

Re: Linux named pipes programming problem

 
 
Joe Estock
Guest
Posts: n/a
 
      12-13-2005
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
 
Reply With Quote
 
 
 
 
abottchow@yahoo.com
Guest
Posts: n/a
 
      12-13-2005
Thanks Joe!
-George

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux, named pipes (mkfifo) and a hanging application avishaih@mangodsp.com C Programming 17 01-13-2009 12:40 AM
Python and named pipes problem Tomek Python 0 02-26-2008 03:15 PM
Linux named pipes programming problem abottchow@yahoo.com C Programming 0 12-13-2005 04:00 AM
IPC Mechanism Named pipes or Windows messages or sthg else ? piyush ASP .Net 0 07-14-2004 02:41 PM
Bidirectional named pipes on Linux Phil Tomson Ruby 11 06-17-2004 10:04 PM



Advertisments