Skip to main content.
home | support | download

Back to List Archive

Re: Newline sometimes ignored in TXT-parser?

From: Bill Moseley <moseley(at)>
Date: Sun Nov 25 2001 - 14:16:46 GMT
At 05:57 AM 11/25/2001 -0800, Arne Georg Gleditsch wrote:

>> If you have a program generating -S prog-formatted data, why not have swish
>> call your program in the first place?
>Mainly because the program is doing a lot of things with the data
>underlying the -S prog-stream, and swish-indexing might or might not
>be a part of that.

Ok.  I was just thinking that if you have a program that creates output
designed to -S prog, why not just use -S prog to run that program.  No need
for temporary intermediate file.  But you don't have to do it that way.

>There are two things bothering me about it, and that's (1) that it
>depends on swish-e not doing anything funky with stdin (like closing
>it) of the child program (cat) that it spawns under -S prog, and (2)
>that it depends on cat always being there and being in /bin/cat.

I don't think it touches stdin.  I does a popen and reads from the pipe.
It will close the pipe early if it detects an error, so you might see a
SIGPIPE in the external program.

Would perl be more portable than cat?  My guess is that if you are running
someplace where there's no /bin/cat then swish might take a little more
work to get swish running in the first place.  Windows might be the exception.

Are you thinking about distributing files for indexing that are
pre-formatted for -S prog input?

Bill Moseley
Received on Sun Nov 25 14:17:14 2001