Skip to main content.
home | support | download

Back to List Archive

Re: Filters on WinNT

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Nov 06 2001 - 18:21:52 GMT
At 09:29 AM 11/06/01 -0800, David L Norris wrote:
>Bill, are you using the swishe.exe I built the other day?  Can you try
>the Aug 5 build?

I'm using the build in CVS.  I can't really do any debugging without a MS
compiler.  When I checked with my cygwin compiler it did ok, but that's
unix emulation.

>I had very little trouble using pdftotext with the Aug 5 build.  But, I
>do believe the online documentation doesn't match the Aug 5 win32
>build.  I seem to recall that the number of parameters changed at some
>point.  
>
>Something similar to this I believe:
>  FileFilter .pdf "pdftotext.exe %p"

That's won't work.  The config is:

  FileFilter extension program [options]

So swish sees "pdftotext.exe %p" as one parameter, so if you are indexing
file 'test.pdf' swish will call pdftotext like

        pdftotext.exe %p test.pdf test.pdf

which is not what you want.  If you want %p substituted by swish then it
must be an option.

    FileFilter .pdf pdftotext.exe "%p -"

Then swish will call it like

    pdftotext.exe test.pdf -

You can see this below.  We also call popen in "r" mode, which is probably
not a problem since line endings are not important.


   /* if no filter cmd param given, use default */

   opt_mask = (fi->options) ? fi->options : "'%p' '%P'";
   cmd_opts = filterCallCmdOptStr (opt_mask, fprop);

   len = strlen (fi->prog) + strlen (cmd_opts);
   filtercmd=emalloc(len + 2);
   sprintf(filtercmd, "%s %s", fi->prog, cmd_opts);

   fp = popen (filtercmd,"r");  /* Open stream */



>There could be a problem with the most recent build (Nov 3 or so).  I've
>done minimal testing and some new things may not work right.  I'll try
>to do some debugging tonight.

Great!


Bill Moseley
mailto:moseley@hank.org
Received on Tue Nov 6 18:22:36 2001