A trick with perl
Tom Anderson
tanderso at oac-design.com
Tue Jan 6 07:51:23 CET 2004
On Mon, 2004-01-05 at 11:12, David Relson wrote:
> On 12/24 a patch from Henning Makholm was added to 0.15.12 to help with
> that situation - letting bogofilter run via pipe instead of
> stdin/stdout. If you're interested, look for function
> bogoreader_close_ifeof(), how it is used, and how feof() is used. I
> don't know enough about pipes to evaluate the patch, test it, or debug
feof() just returns a boolean regarding whether the EOF indicator is
found on a given stream, and bogoreader_close_ifeof() calls
bogoreader_close() when feof(fpin) is true.
The question is, how do you set the EOF indicator without closing the
stream? Autoflush? I don't recall that working before, but it was
probably an earlier version than 0.15.12.
Autoflush in perl can be set as follows "select((select(W), $| =
1)[0]);". I'll test if bogofilter returns output after a syswrite or
still requires a close() when I get some free time.
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.bogofilter.org/pipermail/bogofilter/attachments/20040106/bb4efd8c/attachment.sig>
More information about the Bogofilter
mailing list