[MOAB-dev] Detecting file types
Tim Tautges
tautges at mcs.anl.gov
Tue Dec 1 09:17:32 CST 2009
Jason Kraftcheck wrote:
>
>
> But MOAB's choice of which reader to use is more complicated that just
> selecting one based on extension. If it doesn't recognize the extension, it
> will try them all until one succeeds. That is a good solution, as there is
> no better test of the type of a file then actually looking at the contents.
> We do provide the information you describe above, as it is useful in some
> cases (e.g. constructing a file dialog in verdict), but I don't think
> utilizing this functionality is the correct solution to Steve's problem.
>
> - jason
>
>
If an extension isn't recognized, though, the function should return NULL or some notion of unknown handler. Also, if
an extension is recognized but the registered reader/writer fails, does it cycle through the others?
Steve should be able to test the results of calling these functions and act accordingly. Whether the read actually
succeeds is another thing that should be handled.
- tim
--
================================================================
"You will keep in perfect peace him whose mind is
steadfast, because he trusts in you." Isaiah 26:3
Tim Tautges Argonne National Laboratory
(tautges at mcs.anl.gov) (telecommuting from UW-Madison)
phone: (608) 263-8485 1500 Engineering Dr.
fax: (608) 263-4499 Madison, WI 53706
More information about the moab-dev
mailing list