[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Getting mhshow to invoke my browser for html parts
From: |
Ken Hornstein |
Subject: |
Re: [Nmh-workers] Getting mhshow to invoke my browser for html parts |
Date: |
Mon, 02 Jun 2014 13:21:32 -0400 |
>I believe that open will examine the contents of the file an invoke the right
>application to read it. On OSX, it could be that it only invokes the
>application associated with the resource type of the file, but I am skeptical
>about that.
Respectfully ... you are wrong. Easy enough to test: copy "foo.pdf" to
"foo.html", and then "open" it; it will open into a browser.
If you dig down into it, "open" uses Launch Services to determine the
application to use to open a particular file. If you haven't specified
a specific application to use, it uses the filename extension. If you
really want to be extra-careful, you can pass an -a flag to open, but
it's not necessary.
(This is the whole reason why temporary files are written out with the
correct extension).
--Ken