Does "show all filename extensions" actually work in Mac OS X?

2

Quite simply, the option in Finder prefs to show all filename extensions is checked, but sometimes when I save something, e.g. a text file, and don't explicitly specify a filename in the save dialog, the file appears in the finder without an extension.

Yet Finder recognizes its type as SimpleText in list view, its icon becomes a preview of the document with the footer "TXT," and Quicklook displays the file correctly.

I have also tried unchecking and rechecking that box after creating the file; the extension does not appear after recheck or even relaunch of Finder. If there's nothing that can be done, that's a satisfactory answer--typing .txt is not a big deal – but I'm just curious! OS X 10.6.7.

Philip

Posted 2011-06-09T16:02:01.447

Reputation: 1 103

Answers

1

It does. If you're sceptical of a file's full name, you can view it by opening terminal, using cd to change to the directory it's in, and then using ls to show the full names of all files in the directory.

What you could be seeing is Finder and Quick Look viewing extra metadata stored in the filesystem. The option in Finder does work though, but you can always use Terminal to get the definitive name of the file in question.

Mathew Hall

Posted 2011-06-09T16:02:01.447

Reputation: 144

1The traditional "Finder Info" metadata, including the type/creator codes, are stored in extended attributes attached to the file's record in the filesystem, not the resource fork. – Spiff – 2011-06-10T05:53:39.083

2

Contrary to popular misconception, file type and creator code information isn't stored in the resource fork, but in the HFS+ metadata, specifically the Catalog File.

– NSGod – 2011-06-11T19:39:48.603

4

In this case, that file really has no extension.

You can double-check in Terminal by opening it and dragging&dropping the file from Finder onto the Terminal window, where its full path including file extension will appear.

Mac OS X has some methods of file type detection that work around missing file extensions, e.g. using extended attributes.

Daniel Beck

Posted 2011-06-09T16:02:01.447

Reputation: 98 421

1

I'm going to guess you're a Windows user who's started using OS X. OS X doesn't have to rely upon a file's extension to recognize file types as Windows does.

Quoting Wikipedia (http://en.wikipedia.org/wiki/File_system#File_systems_under_Mac_OS_X):

On Mac OS X, the filetype can come from the type code, stored in file's metadata, or the filename.

ernie

Posted 2011-06-09T16:02:01.447

Reputation: 5 938

Type codes are no longer in use. GetFileInfo usually shows them as type: "\0\0\0\0". The uniform type identifiers shown by mdls are based on the filename extension. – Lri – 2012-08-16T20:33:20.723