Filename Question

GimmeSlack12

macrumors 603
Apr 29, 2005
5,395
8
San Francisco
The file extension is hidden and if you type it in yourself the computer knows what you're doing. You will not have to retype the extension if you move a file to a PC.
 

epochblue

macrumors 68000
Aug 12, 2005
1,671
0
Nashville, TN
My understanding is that OS X reads files based on the file's metadata and not the extension. It'll look at the first few bytes or so of the file to determine what kind of file it is...

...that's probably overly simplistic because I'm not 100% confident in that answer, but I know it's something along those lines.

Anyone care to clarify?
 

kolax

macrumors G3
Mar 20, 2007
9,186
115
My understanding is that OS X reads files based on the file's metadata and not the extension. It'll look at the first few bytes or so of the file to determine what kind of file it is...

...that's probably overly simplistic because I'm not 100% confident in that answer, but I know it's something along those lines.

Anyone care to clarify?
If you delete the .mp3 line then it remains as a .mp3 with the file extension hidden (unlike Windows which would make the file an unreconised type).

If you rename the file .blah it'll make the extension .blah - and then if you delete the .blah it'll remain as a .blah file.

OSX will ask you if you want to change the extension for that associated file.
 

Fairly

macrumors regular
Sep 24, 2006
160
0
Cambridge UK
My understanding is that OS X reads files based on the file's metadata and not the extension. It'll look at the first few bytes or so of the file to determine what kind of file it is...

...that's probably overly simplistic because I'm not 100% confident in that answer, but I know it's something along those lines.

Anyone care to clarify?
You're mostly wrong. Sorry. The system never looks inside files to deal with associations. That's guesswork at best. Files often have "magics" but they're read by file loaders to prevent apps from crashing and so forth.

Officially the file extension rules but any creator code or file type embedded in the catalog node will in practice override. But they're not portable. So it's recommended you put extensions on files when sharing.