r64: Added a technical discussion of the filetype system.
[rox-filer.git] / ROX-Filer / Help / 4_Filetypes
blob18911393dc4f894d9d5488c484c56388a9c30305
1                         ROX-Filer
2                         A RISCOS-like filer for X
3                         by Thomas Leonard
5                         File types (technical)
7 When the filer sees a file it chooses a MIME type for it. This type determines
8 what icon is used to represent the file and what happens when you open it. Only
9 regular, non-executable files have MIME types.
11 To work out what type to give a file the Filer looks up its extension in a
12 table, which it reads on start up from MIME-types/guess in your Choices
13 directory. This file is in the same format as the gnome.mime file, although not
14 all the information in this file is used at present.
16 To decide what happens when you open the file, the Filer:
18 - Replaces the / in the MIME type with _.
19 - Looks for an item with this name in MIME-types in your choices directory.
20   If this is not found then it tries again with just the media type.
21 - Runs the application it files there, passing the pathname of the file as
22   the only argument.
24 So, double clicking on a file of type text/plain may try to run:
25   ~/Choices/MIME-types/text_plain/AppRun pathname
26 If that's not found then it will try:
27   ~/Choices/MIME-types/text/AppRun pathname
28 The idea is that you create symlinks in MIME-types to applications that you
29 want to handle files of that type.
31 To decide what icon to give a file the Filer tries to find an application which
32 can handle files of that type, as above. It then tries to load an icon with the
33 type name from the application's MIME-icons subdirectory. If this is missing
34 then it tries again using just the media type.
35 If both are missing then it tries again using the application for handling the
36 base type. If that's missing too then it'll use a default icon for that media
37 type from inside ROX-Filer itself.
39 For example: when trying to display something of type 'image/gif' the following
40 files may be tried:
42 Choices/MIME-types/image_gif/MIME-icons/image_gif.xpm
43 Choices/MIME-types/image_gif/MIME-icons/image.xpm
44 Choices/MIME-types/image/MIME-icons/image_gif.xpm
45 Choices/MIME-types/image/MIME-icons/image.xpm
46 ROX-Filer/MIME-icons/image.xpm
47 <built-in default icon>