The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pipe output to script as command line argument IMTheNachoMan UNIX for Dummies Questions & Answers 3 04-26-2008 09:59 AM
how to pipe output of here-document!! sami98 Shell Programming and Scripting 7 02-17-2008 06:40 AM
grep string and output filename happyv Shell Programming and Scripting 3 11-19-2007 08:16 PM
read file and output message happyv Shell Programming and Scripting 12 01-24-2007 05:57 PM
Output the message ust UNIX for Dummies Questions & Answers 1 09-25-2005 05:35 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-17-2006
Registered User
 

Join Date: Apr 2006
Posts: 23
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?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-17-2006
Registered User
 

Join Date: Aug 2006
Posts: 69
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
Reply With Quote
  #3 (permalink)  
Old 08-17-2006
Registered User
 

Join Date: Apr 2006
Posts: 23
thanks, will try it.
Reply With Quote
  #4 (permalink)  
Old 08-17-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 356
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.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0