Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-05-2005, 03:15 PM
|
#1
|
Member
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
|
How does KDE determine file type?
Hi all,
Here is my problem.
I run KDE as my Desktop Env. Now no flame wars please, I just happen to prefer it, but I have just noticed a very strange thing and hope someone can answer it for me.
When using Konqueror to browse my files, and more specifically, my config files in my /ETC directory, I have some files which when I hover my mouse over them, shows in the popup window to be PLAIN TEXT files. while others show up as DIFF files, even though they are both files with the extension .conf.
If I rename the file that shows as a DIFF file by changing itīs extension to be, for example, .txt, then the mouseover shows it to be a PLAIN TEXT file, but if I then rename it back again, it reverts to a DIFF file.
I even have some files that though they have an extension of .conf, show up as C++ files.
Now this is not really a great problem, but purely to fill my curiosity, and to allow me to learn even more about Linux, does anyone have any idea why this happens, and how to tell what file type is what, NOT based on itīs extension.
TIA
|
|
|
01-05-2005, 04:06 PM
|
#2
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
open a console and type:
file --help
it is a program to determine the type of files.
|
|
|
01-05-2005, 05:11 PM
|
#3
|
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018
Rep:
|
My guess is that KDE uses a combination of file extension and use of the 'file' utility mentioned by __J (or something similar) in order to determine file type. If renaming the file extension had an effect on KDE's assessment of what kind of file it is, then clearly it's making some suppositions based on that. The 'file' utility tries to identify files by contents, rather than extension. It's very often accurate. However, I can see where guessing based on extension would be useful, too; you may have a text file (with a .txt extension, to remind yourself what kind of file it is) that contains part of a diff. You want the file to be treated as plain text, rather than viewed in a diff-viewer of some kind. Plain text files can include many different types of data; 'file' tries to distinguish different types.
But actually, I have no idea what method KDE uses to determine file type.
|
|
|
01-06-2005, 12:00 PM
|
#4
|
Member
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
|
OK,
Have done as suggested, and the command:- file -modules.conf returns this----modules.conf: ASCII text.
But, in KDE konqueror, it shows as a Diff file. Is this then a bug in Konqueror/KDE, or is there some more obvious reason that I donīt know about?
Have done a little more digging, and it seems that KDE determines file type from the Mime type, so I can only conclude that something in KDE is broken. Any idea where to find the right configuration file for KDE mime types registration?
Last edited by vdemuth; 01-06-2005 at 12:27 PM.
|
|
|
01-08-2005, 05:08 AM
|
#5
|
Member
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
|
More info,
I have looked at these files using XFM, and they show as plain text files as I would expect. Also using XFCE, TWM, FLUXBOX etc they show as plain text files, which would siggest that this is a problem with KDE and/or Konqueror.
Anyone else any suggestions
|
|
|
All times are GMT -5. The time now is 10:58 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|