From: Ernst De R. <hnr...@in...> - 2003-02-15 19:47:21
|
On Sat, Feb 15, 2003 at 05:37:41AM -0600, Albert Wagner wrote: > On Sat, 15 Feb 2003 17:23:04 +0100 > Ernst De Ridder <hnr...@in...> wrote: > > > On Sat, Feb 15, 2003 at 03:46:46AM -0600, Albert Wagner wrote: > > > Rox uses only the globs capability of the freedesktop database, and > > > then obfuscates all such mimetypes that have an executable > > > permission by overriding the glob derived mimetype with > > > application/x-executable. Can we have a switch that turns off this > > > obfuscation? It is currently > > > > I think there is one? In Options.Filetypes there's a checkbox 'ignore > > eXecutable bit for known mime-types'. Or isn't that what you meant? > > That switch is actually: 'ignore eXecutable bit for known extensions', Oops. You're right. > which doesn't do what I want. There are a variety of file types that > may be executable and they often do not have extensions, e.g. bash, > perl, python and ruby files. This is why to differentiate them you must > use magic, at least selectively on executables. I understand now what you mean. But why would you want to know the difference? When you want to run it, you click it, when you to have a look at it, you shift-click it. Works for either binary or text. From a general point of view, overriding derived mime types because of a particular bit is of course a bit untidy - but it is also a practical solution. > > 1) magic is slow. It requires reading every file. Try finding xplore > Yes, I can see how, if it is used on each file in a large directory that > it would be slow; But not as slow as the user selecting info on each one > individually in order to read the File(1) says... :-) > Yes, I understand that it is sometimes wrong and in those cases should > be avoided. But, what if it were used selectively, only on executables > without extensions, to differentiate between binary executables and > translated text executables? It seems that it would always be correct > in that case because the differences are explicit: #!/usr/bin/env <lang> > and etc. in the first line. As long as you don't make a habit of browsing /usr/bin, this should work performance-wise. I can't think of anything that speaks against that solution: if no mime glob matches and executable bit set then check magic Right? Ernst -- Ernst de Ridder - hnr...@in... Universitaet Rostock - Lehrstuhl fuer Theoretische Informatik Albert Einstein Str. 21 - D-18051 Rostock - Germany http://wwwteo.informatik.uni-rostock.de/~hnridder |