Written by

~~ retired but not tired ~~
Question Robert Cemper · Nov 20, 2023

Working with Named Pipes

While creating my latest examples for the JavaContest I faced the need
to communicate with my code from a program in IRIS to my Java code.

Communication with |CPIPE| worked as READ or WRITE  but not both?
In the Documentation Named PIPEs are explained rather shortly.
"Once open, a pipe acts like an ordinary device."  Not so precise.
I failed to achieve my expected READ/WRITE  as TCP would offer. 

Has anyone a working example to demonstrate it? 
Any suggestion is welcome.

I found a workaround for my actual case.
Though I'm not so happy with it.

Product version: IRIS 2023.2

Comments

Enrico Parisi · Nov 21, 2023

Command pipes (CPIPE) or Named Pipes (NPIPE)??

Any little, as simple as possible, test code of what you tested?

Enrico

0
Robert Cemper  Nov 21, 2023 to Enrico Parisi

CPIPE ../WRITE  works here  https://github.com/rcemper/java-global-editor

set cpipe="|CPIPE|1"
 		,cmd="cd /opt/irisapp/ && java gedi > g.log"open cpipe:(cmd:/WRITE)
 	;; later in loopuse0read"?:",opt,!
		use cpipe write opt,!
 	;;;

With NPIPE   I just was lost  ,  
OPEN hangs or  has timeout....
no idea ; Could be the Ubuntu side in Docker was wrong.
 

0
Robert Cemper  Nov 22, 2023 to Enrico Parisi

I also did some experiments using netcat in my container.
Using Ubuntu pipe files works somehow. But it was not convincing.
Ubuntu experts may do it better. 

0
Robert Cemper  Nov 22, 2023 to Enrico Parisi

I just learned here that "NAMED PIPE" is significantly different in

  • UNIX/Linux where it is just a kind of file structure and
  • Windows where it offers the duplex feature I was looking for

So my workaround (by accident) turns out to be better for my needs than the Linux FIFO feature
as I'm able also to read partial lines and don't need newlines or similar as separators.

it was kind of Lucky Punch

0