AMOS Filetype Inference

_FILETYPE is a procedure to infer the format of a file. The file _FILETYPE.AMOS contains the procedure. It takes one parameter — the name of the file (including the path if the file is not in the current directory). It is easy to extend to include more filetypes, just by adding more DATA statements to the end of the existing filetype list. The filetype is identified by two ASCII or binary sections, and as the program returns the first match, you can place the data for a generic filetype (for example, XML) after more specific examples (for example, XHTML). This is the same method used in the ClassAction Workbench enhancement.

This article was last edited on 15th April 2007. The author can be contacted using the form below.
Back to home page
Bookmark with: