Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: file associations

  1. #1
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    file associations

    I like programs to be associated with the file content (as returned by the file command) and not with the file extension. If I have e.g. a picture called 'screenshot.txt' (yes, you can call me an idiot), it needs to be opened with an image viewer and not with gedit if I double click it in Nautilus.

    How do I achieve this?

    Using both 10.04 and 12.04.
    Last edited by Wim Sturkenboom; November 15th, 2012 at 12:42 PM.
    If you don't make backups of your important data, your data is obviously not important to you.

  2. #2
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: file associations

    Quote Originally Posted by Wim Sturkenboom View Post
    I like programs to be associated with the file content (as returned by the file command) and not with the file extension. If I have e.g. a picture called 'screenshot.txt' (yes, you can call me an idiot), it needs to be opened with an image viewer and not with gedit if I double click it in Nautilus.

    How do I achieve this?

    Using both 10.04 and 12.04.
    hi
    yeah for nautilus it would be useful to use the file command. but on the side somtimes
    it's funny that some software don't use this command.
    if i try to send a file ends with .exe mail mailer tells me: it's not allowed to executable files !
    ok i renamed the file to .txt - and here we go )
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  3. #3
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: file associations

    If you don't make backups of your important data, your data is obviously not important to you.

  4. #4
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,543
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: file associations

    Don't mind if I mark that bug as affecting me

  5. #5
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    801
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: file associations

    Playing around with the File Types Editor (assogiate), I found some important info but no solution.

    1) The MIME subsystem gives precedence to file extension over file contents when guessing a file type.

    2) The solution would be to edit type text/plain and remove extension .txt
    However, in practice, that's impossible. The file type is LOCKED for anything but adding stuff.

    Perhaps the bug report should contain a reference to this potential but inoperable workaround.

    Cheers!
    Last edited by LewisTM; November 18th, 2012 at 06:50 PM.
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  6. #6
    Join Date
    Aug 2011
    Location
    near Nîmes, France
    Beans
    43
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: file associations

    Should this not be a request for new function rather than a bug? The file extension, on some systems the filetype, has been used to define the format of the associated file for quite a while. Only some types of file incorporate a heading which gives a definitive clue to the type of file.
    Would there not also be a performance hit if you always had to open a file to find out what it was, unless you had the ability to turn off the function? Also if you had to open the file to find out you could not process it further. Perhaps you could limit the function to particular folders?

  7. #7
    Join Date
    Dec 2009
    Beans
    5,375

    Re: file associations

    Quote Originally Posted by Peter Maunder View Post
    Should this not be a request for new function rather than a bug? The file extension, on some systems the filetype, has been used to define the format of the associated file for quite a while.
    Is that true? UNIX had no file extensions. A "." was just another legal character. Windows is another matter.

  8. #8
    Join Date
    Jun 2007
    Beans
    13,059

    Re: file associations

    As far as the bug report - not really Ubuntu's problem/issue/concern, you should file upstream
    (whether you get any positive response from the gnome/nautilus/redhat dev's is questionable
    https://bugzilla.gnome.org/

  9. #9
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: file associations

    I agree that extensions don't exist in a NIX environment and therefor it's a bug and not a request.

    And support in the bug report is always welcome

    And it's an Ubuntu problem; I don't know how far the Ubuntu developers have modified the code to tailor it to Ubuntu's needs and therefor those developers might have introduced the bug. So I drop it in their lap and they can take it upstream if that is where the problem is.
    Last edited by Wim Sturkenboom; November 18th, 2012 at 08:06 PM.
    If you don't make backups of your important data, your data is obviously not important to you.

  10. #10
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    801
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: file associations

    Quote Originally Posted by Peter Maunder View Post
    Would there not also be a performance hit if you always had to open a file to find out what it was, unless you had the ability to turn off the function?
    I agree, there is nothing magical about MIME type determination by content, it does take its toll. You don't enter a store and open every box and bag to learn what's inside, you read the labels. For the same reason, files are opened only when the extension is absent or unknown. It's not a bug, it's a compromise.
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •