GNOME Bugzilla – Bug 539720
gnome-open configuration is inconsistent
Last modified: 2008-06-30 09:13:53 UTC
Please describe the problem: I can create 2 files, each with a different MIME type (where one is a text/* variation other than text/plain), and gnome-open can't open either of them. Then I try to assign the same action for both MIME types via ~/.local/share/applications/defaults.list and gnome-open will open one file but not the other. Really, I'd like to find a way of opening all text files using a particular application... but I can't figure out how to do that because I can't find any documentation for gnome-open. So, this is either a bug in gnome-open, a bug in some other mysterious GNOME component, or a documentation bug. Steps to reproduce: 1. Create 2 files of interest: ==> a.txt <== From foo Path: bar ==> b.txt <== Path: bar 2. Check the MIME types: $ file -i [ab].txt a.txt: text/x-news; charset=us-ascii b.txt: message/news\0118bit 3. Try to open each file from the command-line with gnome-open. Both should fail, unless you've got something interesting setup. Result is: Error showing url: There is no default action associated with this location. 4. Create sensible looking entries in ~/.local/share/applications/defaults.list [Default Applications] message/news=gedit.desktop text/x-news=gedit.desktop 5. Try opening both files again with gnome-open. For a.txt I get the same result as before. b.txt opens in gedit as expected. Actual results: I feel like opening a window and yelling: I'm mad as hell and and I'm not going to take it anymore! :-) Expected results: I expect both files to open with gedit. Does this happen every time? Yes. Other information: This is under Ubuntu 8.04 (Hardy). This bug was discovered when trying to open some files in a zip archive email attachment via file-roller. file-roller confuses things by listing many different types of files as "plain text document". Perhaps it just does that based on extension? Yep, if I rename a.txt to a.c then file-roller claims it is "C source code" but still can't open it with a default application. I'll report another bug on file-roller. For some strange reason in this version of *something* (GNOME? gnome-open? libgnome?) I'm completely unable to get gnome-open to open certain variations of text files. I'm pretty sure some of these files opened without any questions in whatever version of GNOME came with Ubuntu 7.10 (Gutsy). The lack of (easy to find?) documentation on how to configure gnome-open has frustrated me many times. I can usually solve problems by using strace to figure out which files are being opened, copying lines and modifying them. This particular problem doesn't seem to obey any sensible logic. :-(
*** Bug 539727 has been marked as a duplicate of this bug. ***
Does using gvfs-open instead of gnome-open work as expected?
Yes. gvfs-open opens both files in gedit. I'm wondering why it works... how it determines the file type and associates it with an application. Is there any user documentation for gvfs-open? There is no useful documentation in the gvfs-bin_0.2.4-0ubuntu1 Ubuntu package. :-(
The mimetype->programme associations can be set by right-clicking a file of the given type in nautilus, Properties, and choosing the right programme in the Open With tab. *** This bug has been marked as a duplicate of 530752 ***
Hang on... :-) The main problem here is that the first time the user sees the file is in some other application, such as file-roller. They then have no opportunity to set a file-type in file-roller - file-roller seems to ask gnome-open, or similar, to open the file and there's no association for the MIME type, so it throws up a confusing dialog box that displays an empty list of available applications. :-( In fact, I can currently open the files in Nautilus, so it obvious uses gvfs-open and not gnome-open. So, Nautilus/gvfs-open is falling back to much simpler file type identification? It just uses the filename extension. If I rename the file a.txt to a.c and do an "Open with...", "Open with other application..." and select Firefox, then I get an association for text/x-csrc, even though the file contents have not changed? OK, that seems simpler... not necessarily better than having an association for text/*, as identified by libmagic... but certainly simpler... ;-) One thing I notice is that using the above method to open the file (i.e. with other application) sets an association in mimeapps.list, but choosing one of the other applications that are available by default does not set the association. That seems counter intuitive! :-(