Sponsored Content
Full Discussion: how to use fifo
Top Forums Programming how to use fifo Post 302075576 by grumpf on Monday 5th of June 2006 10:15:31 AM
Old 06-05-2006
Are you sure you need fifo's or is it only a trial ?
instead of fifo's you can easly use (unix-) sockets or do 'man socketpair' if you have to processes to connect.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FIFO over NFS

Hi All L2000-44 HP-UX 11.00 I am attempting to setup a FIFO over NFS. Directing and reading from the FIFO works fine on the local machine - however when I direct to the FIFO from a server which has the directory NFS mounted it does not work. The a process to read from the FIFO on the local... (2 Replies)
Discussion started by: saabir
2 Replies

2. UNIX for Advanced & Expert Users

FIFO Pipes

Hi...Can anyone please guide me on FIFO Pipes in UNIX.I have lerant things like creating fifo pipes,using them for reads and writes etc.I want to know what is the maximum amount of memory that such a pipe may have? Also can anyone guide me on where to get info on this topic from? (4 Replies)
Discussion started by: tej.buch
4 Replies

3. UNIX for Dummies Questions & Answers

Doubts on FIFO

Hi , I m beginner for Unix and i want to use FIFO in my 2 Scripts . I want 1 script to read data from FIFO and other will write into FIFO. Despite reading so many articles/posts i am still unable sunchronize my scripts. My doubts are 1> Do We require both scripts as daemons to use... (0 Replies)
Discussion started by: Akshay
0 Replies

4. Programming

FIFO's and asynchronousity?

Hello, I have a FIFO which i would like to open O_WDWR | O_NONBLOCK | O_ASYNC and have a SIGIO signal generated when there is input on the FIFO, but there a re a bunch of bugs surrounding this (like for instance i read somewhere that you have to set O_ASYNC with fcntl etc. is this even... (0 Replies)
Discussion started by: davo666
0 Replies

5. Programming

help About fifo and thread

hi, my problem is i have 10 thread for produces double two dimensional array these will produces 2d array 400 times ,then i have a thread to takes a two dimensional array then it inverse , and most 10 array can be in the fifo , and threads given takes one by one, now my problem is , i cant... (0 Replies)
Discussion started by: bblackened
0 Replies

6. Programming

How to see a FIFO from all the threads?

Hello C programming fellows!!! I'm doing a program with multiple threads in gnu/linux, ubuntu for beeing precise... This program consist in multiple threads, as logical each thread do different things and communicate to each other using IPC. The problem is that in "process 1" I have a... (1 Reply)
Discussion started by: Sandia_man
1 Replies

7. Programming

fifo

Dear friends i'm want to implement a program which one file is split into fragments by the server (by some random size) and sent to some processes, so these processes get randomly the fragments of the original file from the server, then the downloader randomly connects to some of these processes... (0 Replies)
Discussion started by: saman_glorious
0 Replies

8. Programming

Help With FIFO problem...

=server.c= #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <signal.h> #define MSGSIZE 50 (1 Reply)
Discussion started by: sponge
1 Replies

9. UNIX and Linux Applications

FIFO

Hello , I am working on unix FIFO IPC. i have a doubt regarding that. If the fifo is updated(write()) through one process....can we able to send any signal that fifo is updated and ready to get read...to other process.?? (0 Replies)
Discussion started by: Harry443
0 Replies

10. UNIX for Beginners Questions & Answers

Mplayer fifo.

Hi all, First of all, sorry for the pastebin link. The code tags aren't working for me. #!/bin/bash # while-menu-dialog: a menu driven - Pastebin.com This is a channel "changer" shell script i'm working on. It uses dialog to display the menus. It... (3 Replies)
Discussion started by: ignatius
3 Replies
POPEN(3)						   BSD Library Functions Manual 						  POPEN(3)

NAME
popen, pclose -- process I/O LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> FILE * popen(const char *command, const char *type); int pclose(FILE *stream); DESCRIPTION
The popen() function ``opens'' a process by creating an IPC connection, forking, and invoking the shell. Historically, popen was implemented with a unidirectional pipe; hence many implementations of popen only allow the type argument to specify reading or writing, not both. Since popen is now implemented using sockets, the type may request a bidirectional data flow. The type argument is a pointer to a null-terminated string which must be 'r' for reading, 'w' for writing, or 'r+' for reading and writing. In addition if the character 'e' is present in the type string, the file descriptor used internally is set to be closed on exec(3). The command argument is a pointer to a null-terminated string containing a shell command line. This command is passed to /bin/sh using the -c flag; interpretation, if any, is performed by the shell. The return value from popen() is a normal standard I/O stream in all respects save that it must be closed with pclose() rather than fclose(). Writing to such a stream writes to the standard input of the command; the command's standard output is the same as that of the process that called popen(), unless this is altered by the command itself. Conversely, reading from a ``popened'' stream reads the command's standard output, and the command's standard input is the same as that of the process that called popen(). Note that output popen() streams are fully buffered by default. The pclose() function waits for the associated process to terminate and returns the exit status of the command as returned by wait4(). RETURN VALUES
The popen() function returns NULL if the fork(2), pipe(2), or socketpair(2) calls fail, or if it cannot allocate memory. The pclose() function returns -1 if stream is not associated with a ``popened'' command, if stream has already been ``pclosed'', or if wait4(2) returns an error. ERRORS
The popen() function does not reliably set errno. SEE ALSO
sh(1), fork(2), pipe(2), socketpair(2), wait4(2), fclose(3), fflush(3), fopen(3), shquote(3), stdio(3), system(3) STANDARDS
The popen() and pclose() functions conform to IEEE Std 1003.2-1992 (``POSIX.2''). HISTORY
A popen() and a pclose() function appeared in Version 7 AT&T UNIX. BUGS
Since the standard input of a command opened for reading shares its seek offset with the process that called popen(), if the original process has done a buffered read, the command's input position may not be as expected. Similarly, the output from a command opened for writing may become intermingled with that of the original process. The latter can be avoided by calling fflush(3) before popen(). Failure to execute the shell is indistinguishable from the shell's failure to execute command, or an immediate exit of the command. The only hint is an exit status of 127. The popen() argument always calls sh(1), never calls csh(1). BSD
June 24, 2011 BSD
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy