Haiku stores this information in extended attributes.
Your second command, mimeset, does not determine wether a file has mime type info. Your info dialog above on the other hand is correct.
Storing the mime type this way allows there to be a couple methods to determine the mimetype:
- Pre-determined: The application that saved this file has set the mimetype
- Carried-over: A remote server has specified this mime type and it was carried over (E-Mail MIME or http)
- Sniffed: there was no mime provided and tracker sniffs it as soon as you click on it based on file content (main stream)
To check out the mimetype you have to look at the attributes.
For example, a text file on my computer:
~> listattr error.txt
File: error.txt
Type Size Name
----------------------------------------------------------
Int-32 4 "be:encoding"
MIME String 11 "BEOS:TYPE"
Int-32 4 "wrap"
Int-32 4 "alignment"
Raw Data 160 "styles"
'RECT' 16 "StyledEdit-info"
Int-32 4 "be:caret_position"
203 bytes total in attributes.
These attributes are sometimes app specific or global. Here for example styles and StyledEdit-info are stylededit specific, be:caret_position is specific to “any editor”. wrap an alignment probably too but I’m not sure.
The interesting attribute here for you is BEOS:TYPE
You can inspect this with catattr, for example:
~> catattr BEOS:TYPE error.txt
error.txt : 'MIMS' : text/plain
Where MIMS is the type of the content, and text/plain is the content, and BEOS:TYPE is the label/name of the content.
This example is a plain text file.
Another example I have is a html document:
~> catattr BEOS:TYPE index.html
index.html : 'MIMS' : text/html
Further reading:
https://www.haiku-os.org/docs/userguide/en/workshop-filetypes+attributes.html
https://www.haiku-os.org/docs/userguide/en/applications/cli-apps.html
https://www.haiku-os.org/docs/userguide/en/attributes.html#attributes-terminal