From: | sp.amix |
Date: | 26 Apr 2001 at 19:44:25 |
Subject: | Re: Identifying files |
On 25 Apr 01, at 10:11, arexx@yahoogroups.com wrote:
> Message: 1
> Date: 24 Apr 2001 15:9:48 +0100
> From: "Neil Bothwick" <neil@wirenet.co.uk>
> Subject: Identifying files
>
> Can someone recommend a good system for identifying filetypes? I'm
> particularly interesting in determining the formats of graphics files,
> something that uses datatypes.library would be good as it avoids other
> configuration files. Using Opus filetypes is not an option.
I know of two possibilities you might have in ARexx:
a) datatypes.library itself. It is usable from within ARexx, just as is
amigaguide.library and locale.library.
b) rexxtricks.library: It offers some functions like WhatIs() or GetFileID() (or
similar). Your user will need having WhatIs.library or fileid.library installed,
though.
Another option would be to utilize an external command. But you might want to escape the ADDRESS COMMAND instruction. If not you might want to give GT a chance (short for GetType) a very (!) powerful filetyperecog utility. This one needs IDM.library, though. GT will try to find a filetype by using either idm.library, fileid.library or datatypes.library. It utilizes xfd.library,xpk.library and even more I think. It also has an lformat option. Normally it is used to return the filetype of a file or create an "lformatted" directory listing.
I have had the same problem over a year ago when I started writing an utility in ARexx, that would convert any filetype to any other (as long as it makes sense ;-))
I found none of these solutions satisfying, so I decided to use the standard MIME-TYPES file as known inthe UNIX world. The disatvantage is that MIME- TYPES, as you know, only recognizes the suffix of a file.
Another option might be to hunt down Aminet for Action.lha.
This is a set of utilities that do nothing different than the Dopus5:C/Read,Print,View commands. You know, those which all are the very same command executing the filetype function associated with the naming of this command.
But Action does not rely on Dopus filetypes but uses its own configuration. It is very powerful ! It can also identify by MIME type additionally.
Less powerful is whatis (coming with the fileid.library distro) and there was another library, that came with xpkcybprefs, which also had an external DOS client to retreive filetype info.
Sorry, I fear this is no help. I found none of the solutions perfect so far.
P.S. I just ordered some software at Haage&Partner. They sent me a free issue of AmigaActive (issue #15) as a gimmick. That is a *very* nice mag :-)