output string message to pipe | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

output string message to pipe

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-17-2006
princelinux princelinux is offline
Registered User
 
Join Date: Apr 2006
Last Activity: 11 October 2011, 8:41 AM EDT
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
output string message to pipe

i am new to linux programming. can anyone answer my question?

there is one pipe file "my_pipe"
prw-r--r-- 1 john rnd 32 Aug 17 19:45 my_pipe

how to output string message (char*) to this pipe? which API should I use?
Sponsored Links
    #2  
Old 08-17-2006
apoorvasharma80 apoorvasharma80 is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 20 May 2008, 9:56 AM EDT
Posts: 69
Thanks: 0
Thanked 1 Time in 1 Post
If you have opened the pipe via pipe system cmd then you must have access to 2 file descriptors which are read and write ends for pipe. You can write on the write end of pipe using the 'write' system call.

A better help would be Beej's guide for IPC.

regards
Apoorva Kumar
Sponsored Links
    #3  
Old 08-17-2006
princelinux princelinux is offline
Registered User
 
Join Date: Apr 2006
Last Activity: 11 October 2011, 8:41 AM EDT
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
thanks, will try it.
    #4  
Old 08-18-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
kharkovpromenade.com.ua
 
Join Date: Jun 2006
Last Activity: 10 December 2011, 9:33 AM EST
Posts: 360
Thanks: 0
Thanked 9 Times in 8 Posts
If you already have a fifo file you don't have to do special things to write/read to/from this file. From the point of view of the process it is the ordinary file with write/read capabilities. If you want IPC you can at first create a pipe "in the memory" and use 2 descriptors to read/write.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pipe > output kevincobain2000 UNIX for Dummies Questions & Answers 2 05-24-2012 07:50 AM
is there any way of using rm command on output of pipe sarbjit UNIX for Dummies Questions & Answers 3 05-26-2011 01:01 PM
pipe'ing grep output to awk ziggy25 Shell Programming and Scripting 2 12-14-2009 02:25 AM
pipe output of grep to sed? arsh Shell Programming and Scripting 4 07-01-2009 06:04 AM
pipe output to two files NobluesFDT UNIX for Dummies Questions & Answers 2 08-06-2008 05:54 PM



All times are GMT -4. The time now is 04:29 PM.