dadOpenPipe opens a pipe for reading or writing.
f77: Call dadOpenPipe( Id, Pipename, Dataflow, KeyTable, Split, OpenFlags, err )
integer Id, Split, OpenFlags, err
C: int dadOpenPipe( int *Id, char *Pipename,
char *Dataflow, char *KeyTable,
int Split, int OpenFlags, int *err );
Internally dadOpenPipe performs a call to
- The variable Id returns a handle which will be used in
later calls to the Dad library to specify the opened pipe.
- The Pipename can point to a named pipe on the
local filesystem which
shall be opened for reading/writing. If Split is a number
greater than 1 (i.e. the user wants to split the pipe), the filename
must contain a substring '%d' where the Dad library will insert
the number of the current split branch.
It is also possible to use unnamed pipes for the ID. In this case one
can give the name of a process to be started prepended by a '|' sign
when opening a pipe for writing. The so called process must be able
to look on its commandline for a sequence of '--dadinputpipe arg'.
The arg has then to be passed to the library function
This sets both the internal
file handle for the piping and the global variable dad_instance
to 0 in the first called process and to 1 in the second and so on.
The reading process afterwards has to open the pipe via a call to
f77: CALL dadOpenPipe( Id, '-', Dataflow, 1, CAC_READ, err)
C: dadOpenPipe( &Id, "-", Dataflow, 1, CAC_READ, &err)
- The Dataflow is the name of the dataflow that is expected
to be read/to be written.
You may omit this name in reading mode (set it to ' ') if
- The KeyTable (a new parameter with dad 1.30) contains
either an empty string or the name of the keytable if CAC_KEYTABLE
Openflags (next argument) contains the flag CAC_GENTABLES.
- The Openflags specify the operation mode for the pipe
to be accessed. You use
- CAC_READ for reading a pipe
- CAC_WRITE for writing a pipe
- CAC_GENTABLES (added to CAC_READ) if the metatable
information in the pipe shall be used to
generate the Adamo tables in the library while
opening the pipe.
- CAC_NDELAY if a writing operation would block
dadWrite returns -aEwouldblock and
skips the record.
- CAC_KEYTABLE for access to the keytable. The Keytable
will be available in each of the received
or written records. See
examples on keytable manipulation.
- CAC_MULTI Open a multi record type file/pipe to be accessed
through the functions
- The Err is set to 0 if the call was successfull or contains
a Dad error number.
This page is maintained by Wolfgang Wander