1

In Ubuntu 12.10 there was a nice app called Assogiate. It has ability to add new mimetype, add recognition by content of file and new icon, all done by mouse clicking. Now assogiate disappears from repos. Other programs doesn't have that ability. How to do it by hand?

For example: I have a file test.lzx. This is a packed test file with LZX packer used mostly on Amiga. Gnome doesn't recognize it. If I test file with file command I see:

$ file test.lzx
test.lzx: LZX compressed archive (Amiga)

Recognize that type of file by content is simple. At 0 offset (at the beginning of file) there is a LZX string:

$ hexdump -C test.lzx | head -n 1
00000000  4c 5a 58 00 0c 00 0a 04  00 00 07 00 00 c0 0d 00  |LZX.............|

In Assogiate I was able to add search string and offset where Gnome have to look for this string.

Now question: how to add manually new mime type and make Gnome recognize it by file content?

Answers at

are not related to my question.

Pablo Bianchi
  • 15,657
QkiZ
  • 1,227
  • Other than that you have to edit user files or if needed system files manually but there should be little to no need for doing so (manual edits). – Panther Jul 19 '16 at 17:47
  • I don't want change mime type. I want to add new mime type. – QkiZ Jul 19 '16 at 21:02
  • If you want to add one, edit away ;) The link I gave you shows you how. – Panther Jul 19 '16 at 21:11
  • what link? I don't see any link. – QkiZ Jul 20 '16 at 06:40
  • http://askubuntu.com/questions/179865/how-do-i-change-the-mime-type-for-a-file – Panther Jul 20 '16 at 14:47
  • But how to edit? There is no how to add new file type with recognition by content. Where I should add file type template, hex code description of like file looks in content? – QkiZ Jul 20 '16 at 15:20
  • If you are having a problem you will have to be more specific. The linked answer describers what files to edit and how. The files are plain text. – Panther Jul 20 '16 at 16:30
  • I wrote this post very specific. Linux may recognize file by filename or by content. Writing rules to recognize file by name is simple. It's only regex on filename. Recognize file type by content is similar but linux must know hex regex of specific type. For example there is a ZIP string at start of zip file. All answers in link that you submitted is not related to my question so this is no duplicate. – QkiZ Jul 20 '16 at 18:45
  • Linux uses magic to identify files, not extension. http://www.linfo.org/magic_number.html . Although you feel you asked a good question I have no idea as to what you are wanting that was not answered in the link. Update the question rather then make comments. – Panther Jul 20 '16 at 18:56
  • @DavidFoerster are you really read my question? – QkiZ Jul 31 '16 at 07:48

0 Answers0