Here it is:
/*
* mkfifo.c
*
* makes a fifo (named pipe)
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
int main( int argc, char **argv )
{
mode_t mode;
if( argc < 2 ) {
fprintf( stderr, "USAGE: %s <fifoname> [<mode>]\n", argv[0] );
exit(1);
}
if( argc < 3 ) {
mode = 0777;
} else {
mode = atoi( argv[2] );
}
if( mkfifo( argv[1], mode ) == -1 ) {
perror( "Mkfifo failed" );
exit(1);
}
return 0;
This program creates a fifo in the filesystem. You can use it by
opening it for read on one end and open it for write on the other,
just as you would do for an ordinary file.
Leon.
--
Windows No Thanks!