linking binfmt_misc with mime-types
Brian May <email@example.com> wrote:
> The only thing that comes to mind, is to implement a mini-program
> (unless it already has been written) that takes two parameters, eg
> run-mime-type text/html /path/to/file.html
> That would automatically parse /etc/mailcap and do the `right' thing,
> for the file /path/to/file.html, given it is text/html.
> Entries in /etc/binfmt_misc would contain statements like the above
> instead of the end program.
> This could be implemented with you original proposal with no changes
> (except the extra program), but having it integrated with the mime setup
> would be nice ;-).
Could I clarify some stuff please?
Are we proposing that all mime-types have binfmt_misc setup? Does that mean,
the kernel will be able to `run' any file in mailcap? Is that what we really
I am neither fore, nor against this idea. On the one hand it would be quite
cool, entering the name of an html document on the command line and it loading
in lynx. On the other hand it goes against the Unix philosophy a bit,
documents are programs are documents.
Another question is are their mime-types for all the programs we might want to
run in this way? The programs I can think of off-hand, are Java, DOS EXE, and
Windows EXE, are there any others? If we go with the ability to run documents
like images and so on, do we have all the mime-types? Are we going to have to
invent new mime-types? Is that a bad thing to do?
Some more questions. Is it possible to recognise an html file by a couple of
magic numbers at the beginning? Most html starts <html> or <HTML>, but it is
not certian that it will look like this. Another thought is the possiblilty of
running perl scripts without the bang path, but then how would the shell tell
it is a perl script.
If we put loads of entries into binfmt_misc are we likely to fill some kernel
data table? What happens if it overloads? Do we significantly affect the
performance of the system? If the kernel is checking each file against a list
of magic numbers will it take a long time to run a file? (Probably not the
kernel is fast, and most files we will run will be ELF, which is probably
This is not user independant is it? The system can not be set so that one user
has support for running Java/JPEGs from the command line, and another does
I consume, therefore I am