KDE and the executable bit

Andras Mantia amantia at kde.org
Sat Jan 26 20:58:56 GMT 2008


 as we all know, *nix file system store a property about each file: is 
it executable or not. If it is not, it won't be executed, even if the 
content is executable. The extension, luckily, does not matter.
 In the GUI (KDE) you start executables by clicking on them. That's 
fine, until...you have an executable for what there is an associated 
application. For example, you associated Kate to .sh files, or more 
common, you associated a Python editor to .py files.
In that case KDE ignores the executable bit and happily opens the file 
in whatever application it is specified. 
Short example, which does not require system changes. Create a test.txt  
file with this content:
kdialog --msgbox "I am a GUI application!"

Make this executable (chmod +x test.txt) and click on it in 
The file is not executed, it is opened in your default editor.

I checked and as far as I saw, for some mimetypes, like x-shellscript, 
this is workaround by inheriting from x-executable-script (a KDE hack in 
KDE3, which seems to be adopted by freedesktop).

My simple question is why does not honor KDE the executable bit, 
indifferently of what the mimetype description says? The above test.txt 
is no different from the same file called test.sh. 
Think also of php files (the mimetype does not inherit from x-
executable, but you can have php applications without a web server), or 
other script files.

I know there is a solution by changing the mimetype description, still 
I'd like to hear the reason of this behavior (and possibly what others 
think about).


Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080126/e29c582b/attachment.sig>

More information about the kde-core-devel mailing list