On 2014-03-05 14:36, consused wrote:
> My understanding has always been that Linux relies on file content for
> Type, and not suffixes, leaving the user and application programs free
> to deploy them as part of filename.
That has been the general tradition, yes.
In traditional FAT filesystems, there were 8 chars for the name, and 3
for the extension. No choice at all to just use all letters for the name
with no extension. The dot was not really stored, but assumed. The
operating system and libraries had functionalities to act on extensions
and do things with them. Windows inherited on that, and always (AFAIK)
checks the extension to find out what to do with a file.
Linux did not have that. If you wrote a filename with a extension, it
was in fact a name with a dot somewhere. The dot is another character.
(current Windows filesystems do the same, there is no separate extension
saved).
And, most apps detected the file type by examining contents before
trying to open them this or that way, disregarding the extension.
But there have been exceptions since long ago. For instance, the
Midnight Commander heeds extensions, not contents, since ever, way over
a decade ago.
It is up to the applications to adhere to the Linux tradition of
ignoring extensions or not.
IMHO, Dolphin heeds extensions and not real file type intentionally. By
design.
And Nautilus does the same, I just tried.
I copied a real PDF file and renamed it as a.txt file. Click open, and
it is opened with leafpad, a text editor.
I click open a zero bytes file.pdf, and attempts to open it with Evince…
The column “Mime type” when I select “view details” identifies the false
text file as text (it is a pdf with .txt extension).
However, the “spreadsheet document” with no extension is correctly
identified and opened with LO. If I remove the extensions from the
names, the other files are also correctly identified.
So, nautilus first heeds the extension, and if it does not exist, then
checks contents.
This is no bug, it is intentional design by current Linux developers. No
tradition anymore. >:-P
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)