On Mon, Jul 14, 2008 at 10:21:35AM -0700, firstname.lastname@example.org wrote:
> Is it not working or am I misunderstanding what it's supposed to do? Here's what I did:
> I ran the existing DirTree.pl on some simple files:
> DirTree.pl worked as expected. (Plain.txt was indexed and picture.jpg was skipped because it's a binary.) However, changing the filenames to:
> plain.txt => fake.jpg
> picture.jpg => fake.txt
> completely threw off Swish::Filter. The plain.txt file was no longer indexed and the fake.txt was indexed.
> Isn't Swish::Filter supposed to be using mime types to determine the file type? (and not the extension?)
Yes, it uses content type, but those are coming from the extension.
It only uses the perl module MIME::Types which is a simple lookup.
I think at one point I was using File::LibMagic, but that requires
having the libmagic and database installed which was probably too
restrictive for some users and requires inspecting each file.
Really, SWISH::Filter probably should look for File::LibMagic first,
then try MIME::Types as a fallback.
You could easily hack your version to use that module if you need that
Unsubscribe from or help with the swish-e list:
Help with Swish-e:
Users mailing list
Received on Mon Jul 14 14:21:17 2008