From owner-freebsd-questions Fri Dec 3 22:31:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mashie.force9.net (mashie.force9.net [195.166.128.30]) by hub.freebsd.org (Postfix) with SMTP id F193714BF6 for ; Fri, 3 Dec 1999 22:31:41 -0800 (PST) (envelope-from ric@sinclairassoc.force9.co.uk) Received: (qmail 773 invoked from network); 4 Dec 1999 06:30:13 -0000 Received: from mayfly.plus.net.uk (HELO mayfly.force9.net) (195.166.128.28) by mashie.force9.net with SMTP; 4 Dec 1999 06:30:13 -0000 Received: (qmail 21934 invoked from network); 4 Dec 1999 06:30:12 -0000 Received: from unknown (HELO sinclairassoc.force9.co.uk) (212.56.95.114) by mayfly.plus.net.uk with SMTP; 4 Dec 1999 06:30:12 -0000 Message-ID: <3848B334.C58C3065@sinclairassoc.force9.co.uk> Date: Sat, 04 Dec 1999 06:22:44 +0000 From: Richard Morte X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en-GB,en-US,en MIME-Version: 1.0 To: Richard Morte Cc: freebsd-questions Subject: Re: Help with Perl script References: <3847AE8C.1FA003C1@sinclairassoc.force9.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Isn't it amazing, driving in the car this afternoon - it suddenly occurred to me... permissions! Just needed to chmod 0664 (was 0644) the directory to which the index file is being written. What I don't understand though, was the lack of _any_ error messages - anywhere. The call with system(...) now gives the exit status of 0 as expected, so presumably the previous exit status of 65280 did indicate an error, only that I didn't appreciate the fact at the time. Is there a way to find out what these exit status values mean? Cheers, Ric Richard Morte wrote: > > Hello, > > I've successfully written a perl script as a front-end to swish-e in > search mode. However, I'm out of luck in trying to get it to run in > 'index' mode. > > The swish binary runs OK, (visible quite nicely in 'top') and valid > parameters are being passed. I can even retrieve the verbose output > whilst swish traverses and indexes the document tree, but it never > creates the index file. Here's what I've tried... > > Attempt 1: > system("$swish_bin -i \'$target\' -c \'$config\' -f \'$idx_file\' -l > -v \'$verbose\' -S '$s_method\'") > || local_errors(push (@errors, "600~Could not exec swish: > $swish_bin: $!")); > > Attempt 2: > exec $swish_bin,'-i',$target, > '-c',$config, > '-f',$idx_file, > '-l', > '-v',$verbose, > '-S',$s_method; > || local_errors(push (@errors, "600~Could not exec swish: > $swish_bin: $!")); > > Attempt 3: > $status = system($swish_bin,'-i',$target, > '-c',$config, > '-f',$idx_file, > '-l', > '-v',$verbose, > '-S',$s_method); > local_errors(push (@errors, "600~Could not exec swish: $swish_bin: > $!")) unless $status == 0; > (Note that the exit value ($status) is 65280. When in search mode a > similar construct returns 0 > - which is what I would have expected here...) > > Desperate (and somewhat useless) Attempt 4: > open(SWISH, "$swish_bin -i $target -c $config -f $idx_file -l -v > $verbose -S $s_method|") > or (error-handler stuff, etc) > > FYI: > $swish_bin is the absolute path and filename to the swish executable > $target is the document directory tree (absolute path) > $config is an absolute path and filename to a configuration file > $idx_file is the index file to create (but never gets created), again > abs path and filename > $verbose determines the volume of messages to STDOUT during indexing > (0-3) > $s_method is either 'fs' or 'http' > > None of the attempts produce errors - it's as though the indexing takes > place in hyperspace and never touches the hard disk. I've been through > the O'Reilley Perl books, but cannot see what I'm doing wrong. > > The direction I'm heading in is to run a process that will create the > index file, then figure out a way for the script not to have to wait > until the process completes (processing 1000's of files can take hours) > (Attempt 2 does this already, Attempt 3 will do this if I direct output > to /dev/null?), and finally figure out a way to see how the process > ended to see if indexing is successful. > > Apologies for an off-topic posting, but I'm completely stuck. > > Thanks to anyone who can help! > Ric > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message