Re: detecting file type by magic number


Subject: Re: detecting file type by magic number
From: Kevin Vajk (kvajk@ricochet.net)
Date: Thu Jan 20 2000 - 13:59:52 CST


On Thu, 20 Jan 2000, Thomas Fletcher wrote:

> What I hate about this is that we are relying on the
> <abiword> being at the start of the file, which isn't
> necessarily the case ... it could be after a wack of
> blank spaces or after an XML comment section.

I know, it bugs me too. But I don't see much choice.
Besides, *we're* not relying on it, since we could
import the document in any case, as long as it's valid
XML.

The thing is, there are many applications out there
which want to be able to recognize file types based
on the data they contain. If we don't enforce some
sort of restriction on the XML our exporter writes,
then the only way for those applications to reliably
recognize abiword documents would be to have a full-
blown XML parser built in, and nobody is going to
go for that. We have to throw in a hint or two.

If your file contains a few thousand blank lines
before the abiword tag, it should still be useable
by abiword. But I think it's expecting too much
to want the rest of the world to be able to recognize
it as a valid abiword document.

sterwill suggested something like: <!doctype ...>
leonardr suggested something like: <?xml version="1.0"?>

Damn, I wish I knew XML... :(

- Kevin Vajk
  <kvajk@ricochet.net>



This archive was generated by hypermail 2b25 : Thu Jan 20 2000 - 14:03:57 CST