X

New/Revised Developer Release Notes: File Name Extension Guidelines; Kernel Extensions

New/Revised Developer Release Notes: File Name Extension Guidelines; Kernel Extensions

CNET staff
3 min read
Apple has released several new and revised Developer Release Notes. We post two examples below. Because of our recent coverage of the file name extensions vs. Type/Creator controversy, we offer an extended excerpt from Apple's new document on this topic:

File Name Extension Guidelines covers the new File Name Extension Hiding in OS X 10.1:

    Mac OS X version 10.1 introduces per-file hiding of file name extensions. The experience Mac OS X presents to the user is simple: What you see is what you type. That is, the file name shown in the Finder matches the file name you typed in the Save dialog or in the Finder. If you type a file name with an extension, you see the extension. If you type a file name with no extension, you see no extension.

    The Finder in Mac OS X 10.1 has been enhanced to respect the presence of a file name extension hidden flag stored for each file.

    Files created by Mac OS 9, downloaded from the Internet, or obtained from some other source always have the hide extension flag unset initially, regardless of whether or not they have an extension. Therefore, when a user downloads a file "image.jpg" from the Internet, it does not magically rename itself to "image" in the Mac OS X Finder. What the user sees stays consistent. If the user later renames the file to "mygroovyimage", the .jpg extension is maintained, but becomes hidden. Again, what the user typed matches what is displayed. In no case will Mac OS X rename an existing file without the user taking a specific action to rename that file, nor will renaming a file ever result in accidental multiple extensions (like " mygroovyimage.jpg.jpg").

    Any file with the hide extension flag set and a known extension has that extension hidden in the Finder. When users edit the name of such a file, they edit only the user-visible portion. If they explicitly type in a known file name extension for the file, either the Finder warns them that what they're doing may change the type of the file (if they enter a different file name extension), or the Finder changes the state of the hide extension flag to show the extension (if they enter a new file name with the proper, currently hidden extension for the file). In all cases, the Finder allows users to make the changes if they wish. What users see in the Finder is what they typed when renaming the file, whether or not they included an extension.

Installing and Removing Kernel Extensions Not exactly new in 10.1, but worth a reminder: If you add a new kext file, you need to restart for it to take effect. And even that may not be enough. In particular:

    The system keeps a cache of installed extensions in order to speed up boot time, and notes any change to the /System/Library/Extensions folder as a cue to update the cache. However, if an installer updates a subfolder of the Extensions folder (as when installing an extension as a plug-in of another), the cache will not be updated. The simplest way to notify the system in this case is to update the modification date of the Extensions folder. You can do this using the UNIX shell command touch, as in

    touch /System/Library/Extensions

    Put this command into a postprocessing shell script for your installer package to guarantee that the extensions cache will be updated.