Wednesday, June 13, 2007

什么是plist 文件?

OS X uses .plist files to store application- and system-related preference information. These files are text files saved in the XML format, which follows a set layout. So it's easy to determine whether a file is corrupted: if it doesn't adhere to the set XML layout, it's corrupted.

There are two ways to check XML preference files. In OS X 10.2 and later, you can use the Unix utility plutil. Just open Terminal and type the following: sudo plutil -s ~/Library/ Preferences/*.plist —and then press enter and provide your password when asked.

In the preceding code, -s tells plutil to suppress output of a successful test, so if you see output, you'll know that it's from an error. You need to use sudo because some preference files, such as those from Micromat's TechTool, are owned by the system even though they reside in the Preferences folder in your user folder.

You can check the top-level system preferences by repeating this command with /Library/Preferences as the folder location.

An application may create a file that fails Apple's test but is not corrupt. If you see a file or two listed for applications that seem to work just fine, you can safely ignore the warnings. If you find a truly corrupted preference file (and don't have a corruption-free backup), quit the application, trash the file, and start over with the application settings.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home