[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: opening local files with arbitrary extensions as HTML



>>>>> In [emacs-w3m : No.09556] Shinichiro HIDA wrote:

$ file -i /usr/share/doc/apache2-doc/manual/howto/cgi.html.en
>> /usr/share/doc/apache2-doc/manual/howto/cgi.html.en: text/html

> On my Debian Etch, `file' command return as follows;

> shinichiro@mars:/usr/share/doc/apache2-doc/manual/howto$ file cgi.html.en
> cgi.html.en: XML 1.0 document text
> shinichiro@mars:/usr/share/doc/apache2-doc/manual/howto$ file -i cgi.html.en
> cgi.html.en:
> shinichiro@mars:/usr/share/doc/apache2-doc/manual/howto$ file --mime cgi.html.en
> cgi.html.en:
> shinichiro@mars:/usr/share/doc/apache2-doc/manual/howto$ file -i -k cgi.html.en
> cgi.html.en: \012- text/xml\012- text/xml

Thanks.

> Actualy, these documents are writen as XHTML 1.0.

The Debian Etch version of `file' seems to be better for the
general purpose than the one in Fedora 7:

$ file cgi.html.en
cgi.html.en: HTML document text
$ file -i cgi.html.en
cgi.html.en: text/html
$ file --mime cgi.html.en
cgi.html.en: text/html
$ file -i -k cgi.html.en
cgi.html.en: text/html

Probably what the `file' command returns depends on the `magic'
file, so it doesn't seem to be a good tool for emacs-w3m for
detecting the content type of an arbitrary file.  For Eduardo Ochs,
I'm going to look for another way.