From: | Rolf Max Rotvel |
Date: | 25 Apr 2001 at 20:27:41 |
Subject: | Re: Identifying files |
Hi Neil Bothwick. You wrote:
> >> Can someone recommend a good system for identifying filetypes?
>
> if ~show('L','datatypes.library') then call addlib('datatypes.library',0,-30)
> type = ExamineDT(file,,VAR)
Under WB 3.9 BB1 you can also access the deficons Arexx port:
The DefIcons ARexx interface
============================
Starting v45.1 DefIcons acts as an ARexx host under the name of "DEFICONS".
To make use of the arexx interface the ReAction arexx.class must be
available. The following commands are provided:
1. IDENTIFY command
Purpose:
This command is used to identify the type of a file, disk or
drawer.
Format:
IDENTIFY <Name>
Template:
IDENTIFY NAME/A
Parameters:
NAME
A fully qualified path to the object to identify (for an example
SYS:Prefs/WBPattern).
Errors:
20 - will be returned in case that the command could not be executed.
This happens when not enough memory is available or when the
object specified via the NAME option couldn't be found.
The RC2 variable contains the AmigaDOS error code.
Result:
In case of success, the ARexx RESULT variable contains the type of the
object (without leading "def_" or ".info" suffix). When there's no
matching entry in the database, the root type (project) will be returned.
Notes:
This function is mainly intended to identify the type of a file. For disks
the RESULT string contains "disk" and for drawers it will be "drawer".
IDENTIFY does not depend on the iconset the user has installed, so you'll
get eg. a "wav" type even when there's no "def_wav.info" icon available.
Example:
/*
** deficons sample script
*/
options results
parse arg name
address DEFICONS
identify name
if (RC > 0) then do
Say "Failed because:" RC2
end
else do
Say "Object is:" result
end
Regards
ARexx mailing list - No flames, no overquoting, no crossposting.
Unsubscribe: Blank mail to mailto:arexx-unsubscribe@onelist.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/