[Insight-developers] New file types added to Code/IO

Kent Williams norman-k-williams@uiowa.edu
Thu, 13 Mar 2003 10:38:52 -0600


I would contend that the application should bear some responsibility for=20
knowing what sorts of files it's going to import;   even an ad-hoc=20
'RegisterOne' would be moderately dangerous with any file format not=20
associated with a file extension.  Given the heuristic tests in the GE fi=
le=20
readers, it wouldn't normally be a problem, but it nags at me.

The method I suggested means that you want to open files of a particular =
type,=20
and only those files.   RegisterOne institutes a rather lengthy fishing=20
expedition for the right file reader.

I guess it's really a case of it not being a perfect world -- not all fil=
e=20
formats have de facto standard file name extension, and not all file type=
s=20
bother to have a meaningful magic number defined at the head of the file.
You just have to muddle along.

On Wednesday 12 March 2003 09:53 pm, Hans Johnson wrote:
> Luis,
>
> Thanks for the comments.  I agree with the only use what you need
> philosphy.  I also believe that the RegisterOne mechanism should work f=
or
> adding those less used file filters to the default file checking.  The
> method that Kent outlined requires that you know what the file type is
> before processing it, whereas RegisterOne method would allow multiple f=
ile
> IO filters to be registered, and the file type be determined automatica=
lly
> at runtime.