Wiki source for CommandXmkpipe


Show raw source

======Command xmkpipe======

====Name====
**xmkpipe** creates a named pipe

====Synopsis====
xmkpipe [options] name

====Description====

Creates a named pipe. If -xml is specified then the pipe is an XDM Item pipe where each element is the internal representation of an XDM Item. Otherwise a Text pipe is created where each item is a character.

if -size is specified it limits the pipe to num bytes (text default 10240) or num elements (default 100)


====Options====
||-x,-xml||Creates an XML (XDM Item) pipe||
||-s,-size num||Limits the pipe to num bytes (text) or num items (xml)||
||-close||Closes the write end of the pipe||





====Example====
%%(shell)
xmkpipe -xml x

{ while xread a ; do xecho $a ; xtype $a ; done <(x) ; echo Done ; } &

for i in <[ 1 to 10 ]> ; do
xecho <[ <elem>{$i}</elem> ]>
done >(x)
xmkpipe -close x
wait
%%
Result
%%
<elem>1</elem>
element()
<elem>2</elem>
element()
<elem>3</elem>
element()
<elem>4</elem>
element()
<elem>5</elem>
element()
<elem>6</elem>
element()
<elem>7</elem>
element()
<elem>8</elem>
element()
<elem>9</elem>
element()
<elem>10</elem>
%%



====Return Value====
Returns 0 if the the pipe was successfully created otherwise 1

----
[[Commands]]
[[CategoryCommands]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki