Sponsored Content
Top Forums Programming Communicate with multiple process using named pipe Post 302574760 by nimesh on Friday 18th of November 2011 09:12:32 AM
Old 11-18-2011
Thank you for the help. But i have another issue now.

I open a FIFO to write
Code:
mkfifo ("pipe1", 0777);
int writefd = open ("pipe1", O_WRONLY);

now how do I write argv[1] to pipe1?
I did:
Code:
   write (writefd, argv[1], BUF_PIPE);

when I run my program with an argument, it doesnt do anything. I have to hit ctrl+C to stop.

Any help!!

Last edited by vbe; 11-18-2011 at 11:05 AM.. Reason: Use code tags for your code!!!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

IPC using named pipe

Hi All, I am facing a vague issue while trying to make two process talk to each other using named pipe. read process ========= The process which reads, basically creates FIFO using mkfifo - ret_val = mkfifo(HALF_DUPLEX, 0666);) func. It then opens the pipe using open func - fd =... (1 Reply)
Discussion started by: sharanbr
1 Replies

2. Programming

IPC using named pipe

Hi All, I am facing a vague issue while trying to make two process talk to each other using named pipe. read process ========= The process which reads, basically creates FIFO using mkfifo - ret_val = mkfifo(HALF_DUPLEX, 0666) func. It then opens the pipe using open func - fd = open... (2 Replies)
Discussion started by: sharanbr
2 Replies

3. UNIX for Advanced & Expert Users

named pipe with persistent buffer

Hey folks, i need communicate between 2 processes in a reliable manner. The information delivery has to be guarenteed. I thought about proc 2 sending a signal to proc 1 when information has being written to disc and wirte() has been verified (sync/flush). The IPC method for the data is named... (4 Replies)
Discussion started by: heck
4 Replies

4. UNIX for Dummies Questions & Answers

Named PIPE

Gurus, I've a File Transaction Server, which communicates with other servers and performs some processing.It uses many Named PIPE's. By mistake i copied a named PIPE into a text file. I heard that PIPE files shouldn't be copied.Isn't it? Since it's a production box, i'm afraid on... (2 Replies)
Discussion started by: Tamil
2 Replies

5. UNIX for Dummies Questions & Answers

Named Pipe contents to a file

I want to copy the contents of a named pipe to a file. I have tried using: cat pipe.p >> transcript.log but I have been unsuccessful, any ideas? (4 Replies)
Discussion started by: carl_vieyra
4 Replies

6. UNIX for Advanced & Expert Users

will a named pipe always be size 0 on filesystem?

I did cat < myFile >> myPipe I was hoping that if I did ls -l, myPipe would now be holding the contents of myFile, and would be the same size. But it was 0. Also strange was that when I did the command above, cat did not return control back to the shell. Why? thanks (4 Replies)
Discussion started by: JamesByars
4 Replies

7. Shell Programming and Scripting

pipe to file named with date

I would like to pipe (redirect ? - what is the right term?) the output of my script to a file named with the current date. If I run this at a command prompt: date +'%Y%m%d" ...it returns "20110429" OK, that's good... so I try: ./script.sh > "'date +%Y%m%d'.csv" I get a file... (1 Reply)
Discussion started by: landog
1 Replies

8. Shell Programming and Scripting

Using Named pipe in shell script

Hi, I want to use a Named pipe to get input from a growing file for further processing. When I prototype this scenario using a while loop, the data is not written to the named pipe. This the script I use to get data into the Named pipe: #!/bin/ksh mkfifo pipe while (( n <= 10 )) do echo... (2 Replies)
Discussion started by: sudvishw
2 Replies

9. Shell Programming and Scripting

Named pipe performance

Hi, I am getting data into a Named pipe. Does Named pipe have any size restriction; I know it does not have any storage and it just passes on the data to the next process. I want to know, if there will be a difference in the Named pipe performance if the data input is more. (I am using DB2... (1 Reply)
Discussion started by: sudvishw
1 Replies

10. UNIX for Dummies Questions & Answers

Named pipe hanging?

Ok, I can't seem to figure this out or find anything on the web about this. I'm on Sun Solaris, UNIX. I have the following test script: #!/bin/ksh touch test.file LOG=./tmp.log rm -f ${LOG} PIPE=./tmp.pipe mkfifo ${PIPE} trap "rm -f ${PIPE}" EXIT tee -a ${LOG} < ${PIPE} & ... (17 Replies)
Discussion started by: Ditto
17 Replies
mkfifo(1)						      General Commands Manual							 mkfifo(1)

NAME
mkfifo - make FIFO (named pipe) special files SYNOPSIS
mode] filename ... DESCRIPTION
creates the FIFO special files named by its operand list. The operands are taken sequentially in the order specified and, if the user has write permission in the appropriate directory, the FIFO is created with permissions 0666 modified by the user's file mode creation mask (see umask(2)). The specific actions performed are equivalent to calling for each filename in the operand list (see mkfifo(3C)). Options recognizes the following command-line options: After creating the FIFO special file, set the permission bits of the new file to the specified mode value. The mode option argument is a symbolic mode string as defined in chmod(1). In the symbolic mode strings, the operators and will be interpreted relative to an initial mode of a=rw. Create any missing intermediate path name components. EXTERNAL INFLUENCES
For information about the UNIX standard environment, see standards(5). Environment Variables determines the locale to use for the locale categories when both and the corresponding environment variable (beginning with do not specify a locale. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used. determines the locale to use to override any values for locale categories specified by the settings of or any environment variables begin- ning with determines the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments). If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single-byte character code sets are supported. RETURN VALUE
returns zero if invoked with at least one operand and if all FIFO special files were created successfully. Otherwise, it prints a diagnos- tic message and returns non-zero. EXAMPLES
The following command creates a FIFO special file named in the current directory: SEE ALSO
chmod(1), umask(1), mknod(1M), mkfifo(3C), standards(5). STANDARDS CONFORMANCE
mkfifo(1)
All times are GMT -4. The time now is 03:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy