Martin DiViaio on Fri, 11 Apr 2003 22:59:05 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Linux FIFOs


[...]

--
GPG Fingerprint: C900 18EF 0C36 4EAF A93C  F073 85D4 8B3C F3D8 077B


On the 11th day of April in the year 2003 you wrote:

> Date: Fri, 11 Apr 2003 16:13:34 -0400
> From: Michael C. Toren <mct@toren.net>
> To: plug@lists.phillylinux.org
> X-Spam-Status: No, hits=-1.5 required=5.0
> 	tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01,
> 	      X_AUTH_WARNING
> 	version=2.44
> Subject: Re: [PLUG] Linux FIFOs
> 
> > I was under the impression pine had simply been told to do a |cat
> > <sig FIFO> and dump it in the editor.
> 
> If pine could be configured to execute an arbitrary program and use it's
> output as the value of the signature, there'd be no need for a FIFO :-)
> My guess is that pine is configured to read the signature from the
> ~/.signature file, which has been replaced with a FIFO.
> 

Yup. I wish I could just tell pine to run the script.

By the way, some trial-and-error lead me to the following loop:

while(1) {
 ...
 select and retrieve quote
 ...
 while(!sysopen(OUT1,$output_stack,O_WRONLY|O_NDELAY)) { 1; }
 write OUT1
 close OUT1
 select(undef,undef,undef,0.2);
}

This does a few things differently.

"tail -f" still only dumps the first quote dumped into the FIFO and then 
hangs. While this is running, the script continues to successfully open 
the FIFO and write to it. It never shows up in tail. The script doesn't 
appear to hang anymore after about a dozen writes to the FIFO.

When I kill the tail, the script doesn't exit with a "broken pipe" error 
anymore (like the original does.)

When I point pine to the FIFO to read the quote and go to create a 
message, the script immediately exits with a "broken pipe" error.

I've also done some other tests. My original script messes around with $/. 
Thinking that might be the problem; I put that into a do loop and still 
get the same results.


_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug