Julia: MIME/media type for .jl files

Created on 1 May 2018  路  11Comments  路  Source: JuliaLang/julia

Would be nice if you could register something like text/julia. :)

upstream

Most helpful comment

Not sure about that, given the current state of JLD.jl.

All 11 comments

There's not even a text/python standard MIME type, so I doubt we could get IETF to accept text/julia. But if anyone here is actually knowledgable about the registration process, please chime in.

However, I would just go ahead and use text/julia if you need a MIME type (the old x- prefix for unregistered MIME types is deprecated).

Python has text/x-python at least, and Rust already has text/rust, for example. I think you don鈥檛 need to register at IANA, more important would be to get an entry at XDG鈥檚 /usr/share/mime/packages/freedesktop.org.xml file. Maybe you know some of the Rust maintainers?

I try to get custom file icons also working for Julia files, but with no official media type, that is hardly possible.

I see. Adding to the freedesktop.org registry sounds like a great idea. Do you know where one goes to propose additions? I can鈥檛 find a link at first glance.

Any volunteers to submit a pull request to freedesktop.org? The rust patch looks pretty trivial to emulate.

We should also register .jld files at the same time, ideally with a "magic pattern" which allows detecting them even without the extension.

Not sure about that, given the current state of JLD.jl.

And .jli (cache) files. Any others?

Note that the "magic" bytes in JLD are at the end of the file: https://github.com/JuliaIO/JLD.jl/blob/master/src/JLD00.jl#L70-L84 ... I don't know if checking for this is efficiently supported by https://linux.die.net/man/5/magic etc?

We can leave magic bytes out for now if they are too likely to change. But it's useful to include .jld at least based on extension, and doing so right now ensures it will be available in distributions in the future when the format stabilizes. (I have no idea whether detection can start from the end of a file, but I imagine it would be relatively slow.)

(There's no inherent reason why seeking to the end of a file would be slow, but I don't see any indication that magic supports this.)

I looked to see if the HDF5 format has any unused header space that can be used to tag a particular flavor of HDF5 file, but I don't see anything usable.

(.jli files already have magic bytes at the beginning.)

Actually, maybe we could use the "File Driver Info" block in HDF5 to tag the file as JLD.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamed2 picture iamed2  路  3Comments

TotalVerb picture TotalVerb  路  3Comments

sbromberger picture sbromberger  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

helgee picture helgee  路  3Comments