Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I'm using PCManFM, I sometimes do the following. I right-click in an empty place in ~/, and choose Make new... --> Empty File. I type some text in it, like 'blabalballabl', and then I save it, e.g., as test.

Now, I double-click this file. Leafpad won't open the file, but instead PCManFM will say that the file is executable. It then asks if I want to execute the file or not. I don't want this to happen, I just want Leafpad to open the file. Right-clicking the file, then changing the default application to open this type of files doesn't help.

Is there any way to force PCManFM to open files like these with Leafpad by default?

I'm using Lubuntu 11.10 32 bit.

PCManFM asks to execute the file

PCManFM asks to execute the file

Changing the default program to open the file doesn't help.

Changing the default program to open the file doesn't help.

The Leafpad file associations look OK.

mimeapps.list looks OK; text/plain should be opened by Leafpad.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Its perhaps worth checking that if you have a mimetype list that its defined correctly:

enter image description here

In the same folder - try removing/renaming any custom leafpad.desktop file just in-case it is due to an error in that definition.

Logout and login for changes to take effect.

share|improve this answer
    
This didn't help. The only file left in ~/.local/share/applications is mimeapps.list. I removed the mimecache in /usr/share/applications, and I moved the defaults.list in there to another location to be sure, but this didn't help me. ~/.local/share/applications/mimeapps.list contains the right associations, as seen in the screenshot I've added. Thanks for your help. –  Exeleration-G Jan 2 '12 at 13:01
    
can you pastebin your mimeapps.list - I want to see if I can reproduce it. Did you check if there is a leafpad.desktop file in the same folder? –  fossfreedom Jan 2 '12 at 13:44
    
There wasn't a leafpad.desktop file in ~/.local/share/applications. I've copied it from /usr/share/applications to ~/.local/share/applications, and now it seems to work. Thanks! –  Exeleration-G Jan 2 '12 at 16:31

This is a common problem when the file is executable. As far as I know, there is no fix other than removing its executable flag:

  1. chmod -x [yourfile], or
  2. Right-click > Properties > Permissions > Uncheck "Make the file executable".

However, this fix will probably not work if the file is on a filesystem that does not support POSIX-like file permissions (e.g. NTFS, vfat, network shares, etc...).

share|improve this answer

I have the solution!: Just add

,noexec

to the options of the ntfs line of /etc/fstab

share|improve this answer
    
Right, but doesn't this prevent other executable files from opening? –  Exeleration-G May 28 '13 at 12:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.