About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Home » Learning Curve

Binary Property Lists

MS ActiveUserHostility™ in Tiger? You can get around it - for now.


Buy It

Try It

Welcome to the Apple Registry: OS X 10.4 Tiger reverts to a binary format for property lists. Actually this format has been available all along. From the manpage for plutil:

NAME
 plutil - property list utility

SYNOPSIS
plutil [command_option] [other_options] file ...

DESCRIPTION
plutil can be used to check the syntax of property list files, or convert a plist file from one format to another.

-convert fmt
 
Convert the named file to the indicated format and write back to the file system.

fmt is one of: xml1, for version 1 of the XML plist format; binary1, for version 1 of the binary plist format.

-o
 
Specify an alternate path name for the result of the -convert operation.

[Note: older manpages will incorrectly give the XML format as 'xm1'. Ed.]

One can then test this operation by copying out a sample property list file - in this case the file for the WebFoundation was chosen for its brevity.

% cat com.apple.WebFoundation.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>WebAcceptCookies</key>
    <string>never</string>
</dict>
</plist>
%

All one needs at this point is a command line.

% plutil -convert binary1 -o binary.plist com.apple.WebFoundation.plist
%

And then hexdump.

% hexdump -Cv binary.plist
00000000  62 70 6c 69 73 74 30 30  d1 01 02 5f 10 10 57 65  |bplist00..._..We|
00000010  62 41 63 63 65 70 74 43  6f 6f 6b 69 65 73 55 6e  |bAcceptCookiesUn|
00000020  65 76 65 72 08 0b 1e 00  00 00 00 00 00 01 01 00  |ever............|
00000030  00 00 00 00 00 00 03 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 24                              |......$|
%

As can be seen, binary property lists contain the signature 'bplist00' (version 0.0?) and the actual text used in the key/value pair is preserved; however everything else is a mishmash, and you can't edit it directly.

Your version of OS X will automatically revert to its preferred format for property lists; on versions prior to Tiger, this was the 'xml1' format; now with Tiger we're into Bill Gates Registry territory with the 'binary1' format.

You can convert any property list files you want - and thereafter edit them as plain text files; you can even replace them in the system in the 'xml1' format; the next time the system writes to them the 'binary1' format will be used again.

So yes, it's a speed bump, and no, this is not going to be popular, but yes, you can get around it for the moment.

At least until Mister Bill again starts to flash his $800 million and demand more.

See Also
PlistEdit: It's Your Computer

About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Copyright © Rixstep. All rights reserved.