Plist
   HOME

TheInfoList



OR:

In the
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
,
iOS iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
,
NeXTSTEP NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer in the late 1980s and early 1990s and was initially used for its range of propri ...
, and
GNUstep GNUstep is a free software implementation of the Cocoa (formerly OpenStep) Objective-C frameworks, widget toolkit, and application development tools for Unix-like operating systems and Microsoft Windows. It is part of the GNU Project. GNUste ...
programming
frameworks A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of. Framework may refer to: Computing * Application framework, used to implement the structure of an application for an op ...
, property list files are files that store serialized
object Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
s. Property list files use the
filename extension A filename extension, file name extension or file extension is a suffix to the name of a computer file (e.g., .txt, .docx, .md). The extension indicates a characteristic of the file contents or its intended use. A filename extension is typically ...
.plist, and thus are often referred to as p-list files. Property list files are often used to store a user's settings. They are also used to store information about bundles and applications, a task served by the
resource fork The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the data f ...
in the old Mac OS. Property lists are also used for localization strings for development. These files use the .strings or .stringsdict extensions. The former is a "reduced" old-style plist containing only one dictionary without the braces (see ), while the latter is a fully-fledged plist.
Xcode Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. It was initially released in late 2003; the latest stable release is version 14.2, released on December 13, ...
also uses a .pbxproj extension for old-style plists used as project files.


Representations

Since the data represented by property lists is somewhat abstract, the underlying file format can be implemented many ways. Namely,
NeXTSTEP NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer in the late 1980s and early 1990s and was initially used for its range of propri ...
used one format to represent a property list, and the subsequent
GNUstep GNUstep is a free software implementation of the Cocoa (formerly OpenStep) Objective-C frameworks, widget toolkit, and application development tools for Unix-like operating systems and Microsoft Windows. It is part of the GNU Project. GNUste ...
and
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
frameworks introduced differing formats.


NeXTSTEP

Under
NeXTSTEP NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer in the late 1980s and early 1990s and was initially used for its range of propri ...
, property lists were designed to be
human-readable A human-readable medium or human-readable format is any encoding of data or information that can be naturally read by humans. In computing, ''human-readable'' data is often encoded as ASCII or Unicode text, rather than as binary data. In most c ...
and edited by hand, serialized to
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
in a syntax somewhat like a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
. This same format was used by
OPENSTEP OpenStep is a defunct object-oriented application programming interface (API) specification for a legacy object-oriented operating system, with the basic goal of offering a NeXTSTEP-like environment on non-NeXTSTEP operating systems. OpenStep wa ...
. * Strings are represented in C literal style: ; simpler, unquoted strings are allowed as long as they consist of alphanumericals and one of . * Binary data are represented as: < '' exadecimal codes in ASCII/nowiki>'' >. Spaces and comments between paired hex-codes are ignored. *
Arrays An array is a systematic arrangement of similar objects, usually in rows and columns. Things called an array include: {{TOC right Music * In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
are represented as: . Trailing commas are tolerated. * Dictionaries are represented as: . The left-hand side must be a string, but it can be unquoted. * Comments are allowed as: and . * As in C, whitespace are generally insignificant to syntax. Value statements terminate by a semicolon. One limitation of the original NeXT property list format is that it could not represent an NSValue (number, boolean, etc.) object. As a result, these values would have to be converted to string, and "fuzzily" recovered by the application. Another limitation is that there is no official 8-bit encoding defined. The defaults utility, introduced in OPENSTEP (1996), can be used to manipulate plist files used for storage of preferences (known as ''defaults'' in NeXTSTEP, hence the name) on the command line via their preferences domain, and this utility can be used to edit arbitrary plist files. This utility superseded three older commands.


GNUstep

GNUstep adopts the NeXTSTEP format, with additions for representing NSValue and NSDate data types. The new typed entries have the form , where ''T'' is a one-letter type code. For example, an NSValue of boolean YES is represented as and NSDate objects are represented as <*DYYYY-MM-DD HH:MM:SS +ZZZZ>. Binary data can also use the more efficient
base64 In computer programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in sequences of 24 bits that can be represented by four 6-bit Base64 digits. Common to all bina ...
format as . The 8-bit problem is implicitly solved as well, as most deployments use UTF-8. All in all, brings the expressiveness and compactness of the human-readable textual format on par with Apple's XML format. GNUstep also has its own binary format, , implemented in . This format is defined recursively like the textual formats, with a single-byte type marker preceding some data. A form of
string interning In computer science, string interning is a method of storing only one copy of each distinct string value, which must be immutable. Interning strings makes some string processing tasks more time- or space-efficient at the cost of requiring more ti ...
is supported via a GS-extension switch. Two relative independent plist handlers are found in GNUstep: the in (CoreFoundation), and the in (Foundation Kit). Both support the binary and XML forms used by macOS to some degree, but the latter is a lot more complete. For example, the two GNUstep-specific formats are only handled in the latter. GNUstep provides a set of plist command-line tools based on , including a version of and .


macOS

While macOS can also read the NeXTSTEP format, Apple sets it aside in favor of two new formats of its own, one XML-based and the other binary. Apple also has a partially-compatible JSON format ().


History

In Mac OS X 10.0, the NeXTSTEP format was
deprecated In several fields, especially computing, deprecation is the discouragement of use of some terminology, feature, design, or practice, typically because it has been superseded or is no longer considered efficient or safe, without completely removing ...
, and a new
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
format was introduced, with a public DTD defined by
Apple An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus ''Malus''. The tree originated in Central Asia, where its wild ancestor, ' ...
. The XML format supports non-ASCII characters and storing NSValue objects (which, unlike GNUstep's ASCII property list format, Apple's ASCII property list format does not support). Since XML files, however, are not the most space-efficient means of storage, Mac OS X 10.2 introduced a new format where property list files are stored as binary files. Starting with
Mac OS X 10.4 Mac OS X Tiger (version 10.4) is the 5th major release of macOS, Apple's desktop and server operating system for Mac computers. Tiger was released to the public on April 29, 2005 for US$129.95 as the successor to Mac OS X 10.3 Panther. Som ...
, this is the default format for preference files. In
Mac OS X 10.7 OS X Lion, also known as Mac OS X Lion, (version 10.7) is the eighth major release of macOS, Apple's desktop and server operating system for Mac computers. A preview of OS X 10.7 Lion was publicly shown at the "Back to the Mac" Apple Speci ...
, support for reading and writing files in JSON format was introduced. JSON and property lists are not fully compatible with each other, though. For example, property lists have native date and data types, which the JSON format does not support. Conversely, JSON permits null values while property lists do not support explicit nulls.


Tooling

The old tool from NeXTSTEP remains available. The command provides an interactive plist editor. It can also be scripted. The utility (introduced in Mac OS X 10.2) can be used to check the syntax of property lists, or convert a property list file from one format to another. It also supports converting plists to Objective-C or Swift object literals. Like the Cocoa it is built on, it takes "old-style" inputs, but does not convert to this type. (The Cocoa from before Mac OS X 10.2 emits old-styled output.) The utility is introduced in Mac OS X v10.5. It takes any input and tries to generate "old-style" plists. Like the GNUstep version, it appears to use the property of Foundation types found in plists, which Apple has specified to produce valid old-style plists. In terms of the internals, Apple provides an open source parser for old style, XML, and binary formats in their C Core Foundation code as CFPropertyList. However, all the utilities and most parts of the system use the closed-source NSPropertyList parser from the Obj-C Foundation Kit. The Swift reimplementation is open source, but is not guaranteed to be identical.


Format

XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
and JSON property lists are hand-editable in any text editor. Additionally, Apple provides support in
Xcode Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. It was initially released in late 2003; the latest stable release is version 14.2, released on December 13, ...
for editing property lists in a hierarchical viewer/editor that can handle plists formatted in binary or
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
, but not JSON. As of
Mac OS X 10.4 Mac OS X Tiger (version 10.4) is the 5th major release of macOS, Apple's desktop and server operating system for Mac computers. Tiger was released to the public on April 29, 2005 for US$129.95 as the successor to Mac OS X 10.3 Panther. Som ...
, Apple provides an
AppleScript AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system aut ...
interface for reading property list files through the System Events application. As of Mac OS X 10.5, Apple provides an
AppleScript AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system aut ...
interface for editing, creating and writing property list files as well. For the XML format, the tags, related Foundation classes and CoreFoundation types, and data storage formats are as follows: The
Binary file A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document fil ...
format is documented in a comment block in the Core Foundation C code source file () for Apple's open sourced implementation of binary plists in its Foundation library. Apple describes the implementation as opaque in its plist(5) manual page documentation, which means that reliance on the format is discouraged. In the binary file format the magic number (the first few bytes of the file which indicate that it's a valid plist file) is the text bplist, followed by two bytes indicating the version of the format. The binary file can store some information that cannot be captured in the XML or JSON file formats. The array, set and dictionary binary types are made up of pointers - the objref and keyref entries - that index into an object table in the file. This means that binary plists can capture the fact that - for example - a separate array and dictionary serialized into a file both have the same data element stored in them. This cannot be captured in an XML file. Converting such a binary file will result in a copy of the data element being placed into the XML file. Additionally the binary file has a UID type that is used to identify data items when serialized. The complete list of data that can be stored taken from the C code source file is as follows: Note the note in many types. This means that the marker byte is only found in files with a format version no lower than the "1?" magic number. The precise way to parse them is more nebulous than the way to parse legacy types, since the CFBinaryPlist implementation only handles version "0?". In practice, these types are never encountered, since NSKeyedArchiver is already capable of capturing these information. A table of offsets follow the object table, which is then followed by a trailer containing information on the size and location of the two tables.


Serializing to plist

Since property lists do not capture all the information and data types required to describe an arbitrary object, an extra layer of encoding and decoding is often done. The OpenStep specification abstracts the operation of serializing any under the protocol. Any class implementing this protocol can have its instances serialized by a subclass to some other format. Two main coders exist for the purpose of serializing objects to plists: * , which converts an object into a block of binary data somewhat like a tagged struct. This class is part of OpenStep, although no concrete format has been defined. In practice, one can use it to serialize an object to a file (skipping the plist), or to embed the data in a plist. It must be read and written in the same order as written. The introduction of deprecates its use. * , introduced in Mac OS X 10.2, transforms the object into an . The main improvement of this format for programmers is that it accesses members not by a fixed order, but by string keys. Internally, it somewhat recapitulates the binary plist format by storing an object table array called in the dictionary. Everything else, including class information, is referenced by a UID pointer. A entry under the dict points to the top-level object the programmer was meaning to encode. Among other things, using an archiver allows for new datatypes to be encoded without changing the plist format itself and it is the preferred way for Apple to encode things like NSSets and null values. Parsing the formats do prove a bit harder, since one more layer must be followed even for some classes plists were supposed to support. Like the binary format which also has an object table, it is possible to create circular references in . Since there is not a UID data type in XML, the integers are stored in a dictionary under the key "CF$UID". Apple publishes an open-source in Swift Corelibs Foundation; like the closed-source Apple Foundation, it restricts output formats to binary and XML only. It also has some test cases showing the results of serialization. GNUstep also has a compatible implementation, which does not limit output formats.


Path language

There is not a single, standardized path language for property lists like
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
does for XML, but informal conventions used by various programs exist. * A dot syntax version is found in the ''keypath'' argument of Apple's . It appears to derive from . * A different format is used by , with a colon syntax for indexing. Neither format is able to express a key with the separator character in it.


Other platforms


Windows

Although best known on Apple or Darwin systems, including iOS and macOS, plist files are also present on Windows computers when Apple software, such as iTunes or Safari are installed. On Windows, the files are typically binary files, although some applications may generate PLIST files in the other formats. On Windows the Apple plist files are stored in the user's home directory under . These plist files on Windows typically store preferences and other information, rather than using the Windows registry. Options for editing PLIST files on Windows are not as extensive as on macOS. If the file is in the XML or JSON format with care a text editor such as Notepad++ can be used. Apple ships a plutil.exe within its "Apple Application Support" package (which is part of iTunes), and it is identical to its macOS counterpart.


NetBSD

Introduced in 2006 and first released with NetBSD#4.0 (2007) is a proplib library, which can be used for serialising data between the kernel and userland. It implements part of the XML plist language. One of the sample users of proplib is the second revision of the sysmon
envsys The envsys framework is a kernel-level hardware monitoring sensors framework in NetBSD. , the framework is used by close to 85 device drivers to export various environmental monitoring sensors, as evidenced by references of the sysmon_envsys_ ...
framework for
system monitor A system monitor is a hardware or software component used to monitor system resources and performance in a computer system. Among the management issues regarding use of system monitoring tools are resource usage and privacy. Overview Software ...
ing. NetBSD's proplib library has also been ported to DragonFly in 2010, and is available since DragonFly BSD#2.8. *


Cross-platform

*
Facebook Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin Mosk ...
's open-source reimplementation of the
Xcode Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. It was initially released in late 2003; the latest stable release is version 14.2, released on December 13, ...
build tool, xcbuild, contains a plist library as well as and . These cross-platform utilities are written in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
. * The
Python programming language Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming p ...
has a builtin module to read and write plist files, in Apple's XML or in binary (since Python 3.4). ProperTree is a cross-platform editor that makes use of this library. ** A third-party library called ccl-bplist has the additional ability to handle NSKeyedArchiver UIDs. * Go has a package that supports four types of plists: OpenStep text, GNUStep text, Apple XML, and Apple Binary. It also handles UIDs in XML and binary formats.


See also

*
Comparison of data serialization formats This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages used exclusively as document file formats. Overview Syntax comparison of human-readable form ...


Notes


References


External links


The plist(5) manual page
at developer.apple.com
Excel add-in for creating plist file from Excel table

Java API for reading/writing various plist formats - compatible with Android

EBNF grammar of GNUstep plists
{{Data Exchange NeXT MacOS NetBSD DragonFly BSD GNUstep Data serialization formats