Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Dec 1999 06:22:44 +0000
From:      Richard Morte <ric@sinclairassoc.force9.co.uk>
To:        Richard Morte <ric@sinclairassoc.force9.co.uk>
Cc:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Help with Perl script
Message-ID:  <3848B334.C58C3065@sinclairassoc.force9.co.uk>
References:  <3847AE8C.1FA003C1@sinclairassoc.force9.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3848B334.C58C3065>