On Sat, 2018-02-24 at 12:10 +0000, Emmanuele Bassi wrote:
> The file(1) commands predates not just Linux by about 20 years, but
> the whole of freedesktp.org, including the shared-mime database, by
> about 30 years.

That's what I thought. On my Debian based distro it appears to ship a
BSD variant.

> Ideally, though, you should ignore file(1) and magic(5) altogether on
> Linux, if you are dealing with MIME types.

Out of curiosity though, what about in the web world where php(1) or
some other ensemble of tools used to serve browser scripts need to
check MIME types? At this time I think they probably all rely on
file(1) and its API?

> Considering that every single xdg-util utility is a shell script that
> calls existing binaries, you can very likely write an
> "xdg-content-type" that calls things like `gio info -a
> standard::content-type` on a file under GNOME, or any other utility
> under other environments, and propose it for inclusion in the xdg-
> util
> suite:
> 
>   https://cgit.freedesktop.org/xdg/xdg-utils

Yes, that could work. For people who have traditional file(1) installed
already, they could have them both on their system and select which one
to use via update-alternatives or some such.

-- 
Kip Warner | Senior Software Engineer
OpenPGP signed/encrypted mail preferred
https://www.cartesiantheatre.com

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
xdg mailing list
xdg@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to