MorphOS Developer
Posts: 1520 from 2003/2/24
From: Finland
@ChrisH
Quote:
I was not able to find any further documentation or examples (I don't even have a "SYS:Prefs/Ambient/filetypes" folder!), so I have some questions:
This directory is created by user or an application installer adding new filetypes. They override default definitions provided by the OS as found in MOSSYS:Ambient/recognition.db.
Quote:
What is the "1" number for on a line of it's own? e.g. Priority? e.g. Number of "Name" entries? or something else?
This is just the the descriptor version number. It must be 1.
To set priority just use Priority keyword:
Quote:
AMTD
1
Name Temporary File
Type application/x-undefined-temporary
Priority -128
Match
...PatternHint #?.tmp
...Name #?.tmp
...AND
...File
...End
End
Priority is at range -128...127 and defaults to 0 (although I dont see there demand for more than maybe five priority levels).
Quote:
Does that "OR" effect "PatternHint" or only the preceeding line (i.e. "Match") ?
Only the preceeding line (the "Match" keyword in this case).
PatternHint is not strictly part of recognition pattern. It is used to speed up the file type recognition and there is Name keyword (like in example above, Name=#?.tmp) to force exact filename match.
Quote:
Does "Type XX/YY" have to be stored in the file "SYS:Prefs/Ambient/filetypes/XX/YY" or is it merely preferred?
Yes it have to be stored there and only there.
Quote:
If no flags are needed, can I get rid of the "Flag" line?
The "flag" line is optional. You can get rid of it.
Quote:
How is this filetype definition associated with an icon in EnvArc:SYS ? Does it use the filename, or the Type inside the file, or something else?
The mimetype associates the default icon. They are not stored in ENVARC but in SYS:Prefs/Presets/Deficons, here is what I have got.
Quote:
System:Prefs/Presets/Deficons> dir
application (dir)
audio (dir)
image (dir)
model (dir)
text (dir)
video (dir)
def_CDDAxdisk.info def_CDxdisk.info
def_disk.info def_drawer.info
def_RAMdisk.info def_SMBFSxdisk.info
def_SMBxdisk.info def_UMSDdisk.info
def_UMSDxdisk.info
And contents of application dir:
Quote:
System:Prefs/Presets/Deficons/application> dir
bzip.info javascript.info
lha.info lzh.info
msword.info pdf.info
rar.info tar.info
x-amigafont.info x-c64-d64.info
x-c64-d71.info x-c64-d80.info
x-c64-d81.info x-c64-g64.info
x-c64-pc64.info x-c64-t64.info
x-c64-tap.info x-c64-x64.info
x-iso-9660.info x-java.info
x-lzx.info x-morphos-prefs.info
zip.info
[ Edited by itix 19.01.2013 - 17:51 ]1 + 1 = 3 with very large values of 1