Hi,
On a mac things are absolutely different. The default icon is not assigned by file extension, it is assigned via the UTI (Uniform Type Identifier). Thus, several, say, Excel 2004 spreadsheet files might have different icons, and different default launching programs, and the file extension doesn't mean a thing - it might be some nonsense or it might be absent (really absent - not hidden).
One of the primary design goals of UTIs was to eliminate the ambiguities and problems associated with inferring a file's content from its MIME type, filename extension, or type or creator code1
More information can be found at
http://developer.apple.com/macosx/uniformtypeidentifiers.htmlThus, custom code should be developed for the purpose of getting an icon for a filetype on MacOSX, because it uses unique technologies not available on other systems.
A sample Objective-C program that gets an icon for a UTI (not the file extension) can be found at
http://files.macscripter.net/joy/files/uticon.mHope this helps.
1 - In MacOS Classic, the type of the file was determined by the application that has created it, and file extensions were absolutely meaningless. These days, file extesions are used by the system to assign a UTI to files of non-Mac origin.