Brian Raymond wrote:
> I haven't looked at the code myself but I imagine it's using file header
> data to determine what it is. Similar in general concept to UNIX file's
> magic number tests.
> 
> That might be wrong but it's an educated guess :).

That's nearly correct.
MS documents have a "storage" based file format. Storages are also used
for the old binary StarOffice files and for WordPerfect documents.

A storage organizes its content in a way comparable to a zip tool, but
mostly without compression (IIRC only Powerpoint stores some streams in
a compressed mode). If you have a program to open such a storage it will
show you the subfolders and streams inside it like f.e. WinZip does it
for zip files.

OOo recognizes the particular format represented by such a storage by
searching for some known stream names that are typical for the format.
Storages also have a stream that contains a format descriptor, that
theoretically can be used for a detection (and is used for StarOffice
binary formats!), but the MS formats have shown that this is not
reliable for them, so we mostly ignore this desciptor and check only for
the stream names.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to