Announcement

Collapse
No announcement yet.

File type - as created, by extension, and by first entry

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    File type - as created, by extension, and by first entry

    Observed an interesting function of Kubuntu (Feisty Fawn in my case) when it comes to system identification of a text file.

    Open Konqueror. Create a text document (Create New | Text File...) and give it any name or just accept the default (Text File), and it is identified with the text file icon, and will open with Kate. The file has no extension by default (it is simply named New File).

    Open this file and type From as the first item in the file. Save and close. The system no longer identifies the file as a text file. It is now identified as a MBOX (Mail Box) file! This is further confirmed by right-clicking on the file. Open with KMail is now an option, and Open with Kate is no longer a selectable option. You can select Open with and type Kate and it will open as expected.

    Now, click and Rename the file by adding .txt to the file name. The system now identifies the file type as text, and again displays with the text file icon, and will open with Kate.

    So, it appears that Kubuntu, or at least Konqueror, identifies file types by how it was created, the extension, or (it seems) by looking into the file and reading the first entry it finds! I just tested this by creating a new text file, opening it with Kate, and typing <head> as the only entry, saved and closed the file. Want to guess how it is identified by Konqueror now!? Yup, as an html file!
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes
Working...
X