How to create a new filetype

Hello guys,

how i can create a own fieltype for my applications?

Greetings Lelldorin

You can find an example how i did it (also its completly outdated because it dont use hvif )
here:
https://code.google.com/p/projectconceptor/source/browse/trunk/src/app/ProjectConceptor.cpp#247

but it should give you maybe a starting point :slight_smile:

If you want to set the filetype of a data file your application creates maybe my code at: http://www.haikuware.com/directory/view-details/system-files/tracker-add-ons/file-filter will be of help.

it’s in the documentation: https://www.haiku-os.org/docs/userguide/en/workshop-filetypes+attributes.html

If you can get hold of a copy of Hacker’s “BeOS Bible”, there’s a lot more detail there. Also his app TrackerGrep, which consists mostly of bash scripts, makes extensive use of new filetypes IIRC. It might be worth studying.

Give your files their own mime type, and register the mime-type with your application.

FileTypes is your friend.

Thanks for all your help, i will take a look.

Greetings lelldorin

Hi!

Programmatically, have a look at DarkWyrm’s lesson 15. It’s C++ of course.
Otherwise, there’s the Terminal command “mimeset” to register a MIME type and “settype” to assign a file type to a file. I guess there’s a system() function to invoke those from within yab.

Regards,
Humdinger