Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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.

share|improve this answer
1  
The 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 Jun 10 '11 at 5:53
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 Jun 11 '11 at 19:39

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.

share|improve this answer

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.

share|improve this answer
    
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 Aug 16 '12 at 20:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.