pipe Funktion


pipe creates two file descriptors which can be used by parent and child processes to communicate data. A child process can be created with the fork Funktion.


	Library:   unistd.h

	Prototype: int pipe(int fd[2]);

	Syntax:    int fd[2];
		   pipe(fd);


On error, pipe returns -1.

Once the pipe has been executed, the data can be transfered using read and write.


Notes:

Make sure that when you read exactly the same number of bytes that are written! I spend HOURS trying to figure out why I was loosing data because of this feature!!

Beispiele:

read and write fixed length records.

read and write variable length records.


Siehe auch:

fork

popen Funktion.

pclose Funktion.

read Funktion.

write Funktion.


Anfang Hauptindex Schlüsselwörter Funktionen


Übers.: G. Junghanns