<s>
An	O
INI	B-Protocol
file	I-Protocol
is	O
a	O
configuration	B-Protocol
file	I-Protocol
for	O
computer	B-Application
software	I-Application
that	O
consists	O
of	O
a	O
text-based	O
content	O
with	O
a	O
structure	O
and	O
syntax	O
comprising	O
key	B-Application
–	I-Application
value	I-Application
pairs	I-Application
for	O
properties	O
,	O
and	O
sections	O
that	O
organize	O
the	O
properties	O
.	O
</s>
<s>
The	O
name	O
of	O
these	O
configuration	B-Protocol
files	I-Protocol
comes	O
from	O
the	O
filename	O
extension	O
INI	O
,	O
for	O
initialization	O
,	O
used	O
in	O
the	O
MS-DOS	B-Application
operating	O
system	O
which	O
popularized	O
this	O
method	O
of	O
software	O
configuration	O
.	O
</s>
<s>
The	O
primary	O
mechanism	O
of	O
software	O
configuration	O
in	O
Windows	B-Application
was	O
originally	O
a	O
text	O
file	O
format	O
that	O
comprised	O
text	O
lines	O
with	O
one	O
key	B-Application
–	I-Application
value	I-Application
pair	I-Application
per	O
line	O
,	O
organized	O
into	O
sections	O
.	O
</s>
<s>
INI	B-Protocol
files	I-Protocol
were	O
also	O
generally	O
used	O
by	O
applications	O
to	O
store	O
individual	O
settings	O
.	O
</s>
<s>
The	O
format	O
was	O
maintained	O
in	O
16-bit	O
Microsoft	B-Application
Windows	I-Application
platforms	B-Device
up	O
through	O
Windows	B-Application
3.1x	I-Application
.	O
</s>
<s>
Starting	O
with	O
Windows	B-Application
95	I-Application
Microsoft	O
favored	O
the	O
use	O
of	O
the	O
Windows	B-Protocol
Registry	I-Protocol
and	O
began	O
to	O
steer	O
developers	O
away	O
from	O
using	O
INI	B-Protocol
files	I-Protocol
for	O
configuration	O
.	O
</s>
<s>
All	O
subsequent	O
versions	O
of	O
Windows	B-Application
have	O
used	O
the	O
Windows	B-Protocol
Registry	I-Protocol
for	O
system	O
configuration	O
,	O
but	O
applications	O
built	O
on	O
the	O
.NET	O
Framework	O
use	O
special	O
XML	B-Protocol
.config	O
files	O
.	O
</s>
<s>
The	O
initialization-file	O
functions	O
are	O
still	O
available	O
in	O
Windows	B-Application
and	O
developers	O
may	O
still	O
use	O
them	O
.	O
</s>
<s>
Linux	B-Application
and	O
Unix	B-Application
systems	I-Application
also	O
use	O
a	O
similar	O
file	O
format	O
for	O
system	O
configuration	O
.	O
</s>
<s>
In	O
addition	O
,	O
platform-agnostic	O
software	O
may	O
use	O
this	O
file	O
format	O
for	O
configuration	O
.	O
</s>
<s>
It	O
is	O
human-readable	B-General_Concept
and	O
simple	O
to	O
parse	O
,	O
so	O
it	O
is	O
a	O
usable	O
format	O
for	O
configuration	B-Protocol
files	I-Protocol
that	O
do	O
not	O
require	O
much	O
greater	O
complexity	O
.	O
</s>
<s>
Git	O
configuration	B-Protocol
files	I-Protocol
are	O
similar	O
to	O
INI	B-Protocol
files	I-Protocol
.	O
</s>
<s>
PHP	B-Application
uses	O
the	O
INI	B-Protocol
format	I-Protocol
for	O
its	O
"	O
php.ini	B-Protocol
"	O
configuration	B-Protocol
file	I-Protocol
in	O
both	O
Windows	B-Application
and	O
Linux	B-Application
systems	O
.	O
</s>
<s>
Desktop.ini	B-Protocol
files	O
determine	O
the	O
display	O
of	O
directories	O
in	O
Windows	B-Application
,	O
e.g.	O
,	O
the	O
icons	O
for	O
a	O
directory	O
.	O
</s>
<s>
The	O
following	O
example	O
file	O
has	O
two	O
sections	O
:	O
one	O
for	O
the	O
owner	O
of	O
the	B-Application
software	I-Application
,	O
and	O
one	O
for	O
a	O
payroll	O
database	O
connection	O
.	O
</s>
<s>
square	O
brackets	O
for	O
sections	O
,	O
newlines	O
for	O
delimiting	B-Algorithm
different	O
nodes	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
Attempts	O
to	O
create	O
parsers	O
able	O
to	O
support	O
as	O
many	O
dialects	O
as	O
possible	O
exist	O
,	O
and	O
in	O
its	O
most	O
advanced	O
form	O
the	O
INI	B-Protocol
format	I-Protocol
is	O
able	O
to	O
express	O
a	O
tree	O
object	O
with	O
a	O
power	O
comparable	O
to	O
that	O
of	O
other	O
structured	O
formats	O
(	O
JSON	B-General_Concept
,	O
XML	B-Protocol
)	O
using	O
a	O
more	O
relaxed	O
syntax	O
.	O
</s>
<s>
The	O
basic	O
element	O
contained	O
in	O
an	O
INI	B-Protocol
file	I-Protocol
is	O
the	O
key	O
or	O
property	O
.	O
</s>
<s>
Every	O
key	O
has	O
a	O
name	O
and	O
a	O
value	O
,	O
delimited	B-Algorithm
by	O
an	O
equals	O
sign	O
(=	O
)	O
.	O
</s>
<s>
In	O
the	O
Windows	B-Application
implementation	O
the	O
equal	O
sign	O
and	O
the	O
semicolon	O
are	O
reserved	O
characters	O
and	O
cannot	O
appear	O
in	O
the	O
key	O
.	O
</s>
<s>
There	O
is	O
no	O
explicit	O
"	O
end	O
of	O
section	O
"	O
delimiter	B-Algorithm
;	O
sections	O
end	O
at	O
the	O
next	O
section	O
declaration	O
,	O
or	O
at	O
the	O
end	O
of	O
the	O
file	O
.	O
</s>
<s>
As	O
the	O
INI	B-Protocol
file	I-Protocol
format	O
is	O
not	O
rigidly	O
defined	O
,	O
many	O
parsers	O
support	O
features	O
beyond	O
the	O
basics	O
already	O
described	O
.	O
</s>
<s>
Some	O
implementations	O
allow	O
a	O
colon	O
(	O
:	O
)	O
as	O
the	O
name/value	B-Application
delimiter	B-Algorithm
(	O
instead	O
of	O
the	O
equals	O
sign	O
)	O
.	O
</s>
<s>
Whitespace	O
is	O
occasionally	O
used	O
in	O
the	O
Linux	B-Application
world	O
.	O
</s>
<s>
Some	O
parsers	O
allow	O
section	O
nesting	O
,	O
using	O
dots	O
as	O
path	O
delimiters	B-Algorithm
:	O
</s>
<s>
Historically	O
,	O
ways	O
for	O
expressing	O
nesting	O
alternative	O
to	O
the	O
dot	O
have	O
existed	O
too	O
(	O
for	O
example	O
,	O
IBM	O
's	O
driver	O
file	O
for	O
Microsoft	B-Application
Windows	I-Application
devlist.ini	O
,	O
in	O
which	O
the	O
backslash	O
was	O
used	O
as	O
nesting	O
delimiter	B-Algorithm
in	O
the	O
form	O
of	O
[A\B\C];	O
or	O
Microsoft	O
Visual	O
Studio	O
's	O
AEMANAGR.INI	O
file	O
,	O
which	O
used	O
a	O
completely	O
different	O
syntax	O
in	O
the	O
form	O
of	O
 [ A ] 	O
and	O
B	O
,	O
C	B-Language
,	O
P	O
=	O
V	O
)	O
.	O
</s>
<s>
Some	O
parsers	O
did	O
not	O
offer	O
nesting	O
support	O
at	O
all	O
and	O
were	O
hierarchy-blind	O
,	O
but	O
nesting	O
could	O
still	O
be	O
partially	O
emulated	O
by	O
exploiting	O
the	O
fact	O
that	O
 [ A.B.C ] 	O
constitutes	O
a	O
unique	O
identifier	O
.	O
</s>
<s>
Some	O
software	O
supports	O
the	O
use	O
of	O
the	O
number	O
sign	O
( #	O
)	O
as	O
an	O
alternative	O
to	O
the	O
semicolon	O
for	O
indicating	O
comments	O
,	O
especially	O
under	O
Unix	B-Application
,	O
where	O
it	O
mirrors	O
shell	B-Device
comments	O
.	O
</s>
<s>
In	O
others	O
,	O
including	O
the	O
WinAPI	B-Library
function	O
GetPrivateProfileString	O
,	O
comments	O
must	O
occur	O
on	O
lines	O
by	O
themselves	O
.	O
</s>
<s>
The	O
second	O
occurrence	O
of	O
a	O
property	O
name	O
may	O
cause	O
an	O
abort	B-General_Concept
,	O
it	O
may	O
be	O
ignored	O
(	O
and	O
the	O
value	O
discarded	O
)	O
,	O
or	O
it	O
may	O
override	O
the	O
first	O
occurrence	O
(	O
with	O
the	O
first	O
value	O
discarded	O
)	O
.	O
</s>
<s>
Others	O
may	O
abort	B-General_Concept
,	O
or	O
ignore	O
some	O
aspect	O
of	O
the	O
INI	B-Protocol
file	I-Protocol
.	O
</s>
<s>
Some	O
implementations	O
allow	O
values	O
to	O
be	O
quoted	O
,	O
typically	O
using	O
double	O
quotes	O
and/or	O
apostrophes	B-Language
.	O
</s>
<s>
The	O
standard	O
Windows	B-Application
function	O
supports	O
this	O
,	O
and	O
will	O
remove	O
quotation	O
marks	O
that	O
surround	O
the	O
values	O
.	O
</s>
<s>
Some	O
implementations	O
offer	O
varying	O
support	O
for	O
an	O
escape	B-Algorithm
character	I-Algorithm
,	O
typically	O
with	O
the	O
backslash	O
(	O
\	O
)	O
following	O
the	O
C	B-Language
syntax	O
.	O
</s>
<s>
Some	O
support	O
"	O
line	O
continuation	O
"	O
,	O
where	O
a	O
backslash	O
followed	O
immediately	O
by	O
EOL	O
(	O
end-of-line	O
)	O
causes	O
the	O
line	O
break	O
to	O
be	O
ignored	O
,	O
and	O
the	O
"	O
logical	O
line	O
"	O
to	O
be	O
continued	O
on	O
the	O
next	O
actual	O
line	O
from	O
the	O
INI	B-Protocol
file	I-Protocol
.	O
</s>
<s>
+	O
Common	O
escape	O
sequences	O
Sequence	O
Meaning	O
\\	O
\	O
(	O
a	O
single	O
backslash	O
,	O
escaping	O
the	O
escape	B-Algorithm
character	I-Algorithm
)	O
\	O
 '	O
Apostrophe	B-Language
\	O
 "	O
Double	O
quotes	O
\0	O
Null	O
character	O
\a	O
Bell/Alert/Audible	O
\b	O
Backspace	B-Device
,	O
Bell	O
character	O
for	O
some	O
applications	O
\t	O
Tab	O
character	O
\r	O
Carriage	O
return	O
\n	O
Line	O
feed	O
\	O
;	O
Semicolon	O
\#	O
Number	O
sign	O
\=	O
Equals	O
sign	O
\	O
:	O
Colon	O
\x????	O
</s>
<s>
Under	O
Windows	B-Application
,	O
the	O
Profile	O
API	O
is	O
the	O
programming	O
interface	O
used	O
to	O
read	O
and	O
write	O
settings	O
from	O
classic	O
Windows	B-Application
.ini	B-Protocol
files	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
function	O
retrieves	O
a	O
string	O
from	O
the	O
specified	O
section	O
in	O
an	O
initialization	B-Protocol
file	I-Protocol
.	O
</s>
<s>
(	O
The	O
"	O
private	O
"	O
profile	O
is	O
contrasted	O
with	O
,	O
which	O
fetches	O
from	O
WIN.INI	B-Protocol
.	O
)	O
</s>
<s>
The	O
following	O
sample	O
C	B-Language
program	I-Language
demonstrates	O
reading	O
property	O
values	O
from	O
the	O
above	O
sample	O
INI	B-Protocol
file	I-Protocol
(	O
let	O
the	O
name	O
of	O
configuration	B-Protocol
file	I-Protocol
be	O
dbsettings.ini	O
)	O
:	O
</s>
<s>
Under	O
Unix	B-Application
,	O
many	O
different	O
configuration	O
libraries	O
exist	O
to	O
access	O
INI	B-Protocol
files	I-Protocol
.	O
</s>
<s>
Examples	O
of	O
INI	O
parsers	O
for	O
Unix	B-Application
include	O
,	O
and	O
.	O
</s>
<s>
Name	O
Sections	O
support	O
Section	O
nesting	O
support	O
Disabled	O
entry	O
recognitionIt	O
is	O
a	O
common	O
practice	O
among	O
authors	O
of	O
INI	B-Protocol
files	I-Protocol
to	O
"	O
comment	O
out	O
"	O
unwanted	O
entries	O
in	O
order	O
to	O
disable	O
them	O
,	O
instead	O
of	O
removing	O
them	O
completely	O
.	O
</s>
<s>
See	O
the	O
key	O
a	O
in	O
the	O
following	O
example	O
:	O
Multi-line	O
supportThe	O
standard	O
syntax	O
for	O
line	O
continuation	O
refers	O
here	O
to	O
the	O
sequence	O
of	O
a	O
backslash	O
followed	O
by	O
line	O
break	O
,	O
as	O
implemented	O
by	O
iniparser	O
,	O
libconfini	O
and	O
java.util.Properties	O
Value	O
types	O
Read/Write	O
support	O
Platform	B-Device
License	B-License
Programming	O
language	O
Latest	O
release	O
version	O
ConfigParserFredrik	O
Lundh	O
.	O
</s>
<s>
"	O
Python	B-Language
Standard	O
Library	O
"	O
.	O
</s>
<s>
p	O
.	O
143	O
"	O
ConfigParser	O
-	O
Configuration	B-Protocol
file	I-Protocol
parser	O
"	O
.	O
</s>
<s>
Initialization	B-Protocol
file	I-Protocol
mapping	O
creates	O
a	O
mapping	O
between	O
an	O
INI	B-Protocol
file	I-Protocol
and	O
the	O
Registry	B-Protocol
.	O
</s>
<s>
It	O
was	O
introduced	O
with	O
Windows	B-Application
NT	O
and	O
Windows	B-Application
95	I-Application
as	O
a	O
way	O
to	O
migrate	O
from	O
storing	O
settings	O
in	O
classic	O
.ini	B-Protocol
files	O
to	O
the	O
new	O
Windows	B-Protocol
Registry	I-Protocol
.	O
</s>
<s>
File	O
mapping	O
traps	O
the	O
Profile	O
API	O
calls	O
and	O
,	O
using	O
settings	O
from	O
the	O
IniFileMapping	O
Registry	B-Protocol
section	O
,	O
directs	O
reads	O
and	O
writes	O
to	O
appropriate	O
places	O
in	O
the	O
Registry	B-Protocol
.	O
</s>
<s>
INI	O
mapping	O
takes	O
this	O
Profile	O
API	O
call	O
,	O
ignores	O
any	O
path	O
in	O
the	O
given	O
filename	O
and	O
checks	O
to	O
see	O
if	O
there	O
is	O
a	O
Registry	B-Protocol
key	I-Protocol
matching	O
the	O
filename	O
under	O
the	O
directory	O
:	O
</s>
<s>
If	O
an	O
entry	O
is	O
found	O
,	O
INI	O
mapping	O
uses	O
its	O
value	O
as	O
a	O
pointer	O
to	O
another	O
part	O
of	O
the	O
Registry	B-Protocol
.	O
</s>
<s>
It	O
then	O
looks	O
up	O
the	O
requested	O
INI	O
setting	O
in	O
that	O
part	O
of	O
the	O
Registry	B-Protocol
.	O
</s>
<s>
where	O
the	O
"	O
name	O
"	O
Registry	B-Protocol
entry	O
name	O
is	O
found	O
to	O
match	O
the	O
requested	O
INI	O
key	O
.	O
</s>
<s>
The	O
result	O
is	O
that	O
any	O
settings	O
not	O
found	O
in	O
the	O
Registry	B-Protocol
are	O
not	O
looked	O
for	O
in	O
the	O
INI	B-Protocol
file	I-Protocol
.	O
</s>
<s>
The	O
"	O
database	O
"	O
Registry	B-Protocol
entry	O
does	O
not	O
have	O
the	O
@	O
prefix	O
on	O
the	O
value	O
;	O
thus	O
,	O
for	O
the	O
 [ database ] 	O
section	O
only	O
,	O
settings	O
in	O
the	O
Registry	B-Protocol
are	O
taken	O
first	O
followed	O
by	O
settings	O
in	O
the	O
dbsettings.ini	O
file	O
on	O
disk	O
.	O
</s>
<s>
Starting	O
with	O
Windows	B-Application
95	I-Application
,	O
Microsoft	O
began	O
strongly	O
promoting	O
the	O
use	O
of	O
Windows	B-Protocol
registry	I-Protocol
over	O
the	O
INI	B-Protocol
file	I-Protocol
.	O
</s>
<s>
INI	B-Protocol
files	I-Protocol
are	O
typically	O
limited	O
to	O
two	O
levels	O
(	O
sections	O
and	O
properties	O
)	O
and	O
do	O
not	O
handle	O
binary	O
data	O
well	O
.	O
</s>
<s>
This	O
decision	O
however	O
has	O
not	O
been	O
immune	O
to	O
critiques	O
,	O
due	O
to	O
the	O
fact	O
that	O
the	O
registry	B-Protocol
is	O
monolithic	O
,	O
opaque	O
and	O
binary	O
,	O
must	O
be	O
in	O
sync	O
with	O
the	O
filesystem	O
,	O
and	O
represents	O
a	O
single	O
point	O
of	O
failure	O
for	O
the	O
operating	O
system	O
.	O
</s>
<s>
Later	O
XML-based	O
configuration	B-Protocol
files	I-Protocol
became	O
a	O
popular	O
choice	O
for	O
encoding	O
configuration	O
in	O
text	O
files	O
.	O
</s>
<s>
XML	B-Protocol
allows	O
arbitrarily	O
complex	O
levels	O
and	O
nesting	O
,	O
and	O
has	O
standard	O
mechanisms	O
for	O
encoding	O
binary	O
data	O
.	O
</s>
<s>
More	O
recently	O
,	O
data	B-Application
serialization	I-Application
formats	O
,	O
such	O
as	O
JSON	B-General_Concept
,	O
TOML	B-Protocol
,	O
and	O
YAML	B-Protocol
can	O
serve	O
as	O
configuration	O
formats	O
.	O
</s>
<s>
These	O
three	O
alternative	O
formats	O
can	O
nest	O
arbitrarily	O
,	O
but	O
have	O
a	O
different	O
syntax	O
than	O
the	O
INI	B-Protocol
file	I-Protocol
.	O
</s>
<s>
Among	O
them	O
,	O
TOML	B-Protocol
most	O
closely	O
resembles	O
INI	O
,	O
but	O
the	O
idea	O
to	O
make	O
TOML	B-Protocol
deliberately	O
compatible	O
with	O
a	O
large	O
subset	O
of	O
INI	O
was	O
rejected	O
.	O
</s>
<s>
The	O
newest	O
INI	O
parsers	O
however	O
allow	O
the	O
same	O
arbitrary	O
level	O
of	O
nesting	O
of	O
XML	B-Protocol
,	O
JSON	B-General_Concept
,	O
TOML	B-Protocol
,	O
and	O
YAML	B-Protocol
,	O
offer	O
equivalent	O
support	O
of	O
typed	O
values	O
and	O
Unicode	O
,	O
although	O
keep	O
the	O
"	O
informal	O
status	O
"	O
of	O
INI	B-Protocol
files	I-Protocol
by	O
allowing	O
multiple	O
syntaxes	O
for	O
expressing	O
the	O
same	O
thing	O
.	O
</s>
