244 points · by franze · 12y ago · 37 comments
"When I click print I get nothing." -Tuesday, August 5, 2008
"I downloaded those updates and Open Office Still prints." -Friday, August 8, 2008
"Open Office stopped printing today." -Tuesday, August 12, 2008
"I just updated and still print." -Monday, August 18, 2008
"I stand corrected, after a boot cycle Open Office failed to print." -Tuesday, August 19, 2008
Just because a bug seems impossible doesn't mean it is.
This comment reminds me of the magic switch (story [0], light HN discussion [1]).
[0]: http://catb.org/jargon/html/magic-story.html [1]: https://news.ycombinator.com/item?id=181045
Anyway, thank you for the link.
(see https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619)
http://standards.freedesktop.org/shared-mime-info-spec/share...
File has its own internal database. It can do more than the mime type db and is great for quickly identifying and getting lots of info about various file types, but it is AWFUL when used within other apps. Please, don't use it like so.
Also, file --mime FILENAME gets you the mime type.
Additionally, the shared-mime-info database is much better curated than the file mime database; file has a lot of wrong mime types (I have gotten a dozen or so fixed so far). If there are file types that are missing from shared-mime-info, please report them on https://bugs.freedesktop.org/ (there are guidelines for good mime type reports, follow those and you can get a fix merged in very fast).
More to the point though, the xdg database is extensible. While `file` requires playing with the source.
~$ xdg-mime query filetype /etc/passwd
text/plain"The query option is for use inside a desktop session only."
Why wouldn't it work from a console session? Or even a non-login session (e.g. cron job)? I'm not sure I want to trust a command-line program that only works as part of a desktop session. It sounds like the sort of fragile doodad that makes weird assumptions about its environment, which might one day no longer be true even in that environment, to me.
Can anyone shed any further light on that crazy usage restriction?
>file main.js
>main.js: ASCII C++ program text, with very long lines"Very long lines" is sort of a property of text files. It means it's unlikely to have been written by hand for one thing.