Jump to content

Talk:INI file

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Ini is deprecated

[edit]

Up to which version(s) of Windows were they the standard? When were they deprecated? Graffiti — Preceding undated comment added 14:55, 3 November 2009

Graffiti's comments

[edit]

Improved the article by adding a typical ini file, and gave some rules indicating how the files are parsed. Also made a reference to a Perl module that makes dealing with ini files a lot easier.

Also I don't agree with the first part of the article (which I haven't written). Although they really were the foundations on Windows sytems, most of the Linux configuration files can be considered .ini files. Check for instance, /etc/samba/smb.conf

Graffiti — Preceding undated comment added 22:31, 4 June 2005

What does ini stand for?

[edit]

I assume it means initialization, but I'm just guessing. I came to this article to find out, but it doesn't say. Does anyone know for sure? --A D Monroe III 15:30, 15 Jun 2005 (UTC)

Okay, this article has been moved from Ini file to Initialization file, so I assume at least some agree that ini means initialization, but I still haven't seen any reference that says this. --A D Monroe III 02:37, 6 August 2005 (UTC)[reply]

The first line of Microsoft's documentation for GetPrivateProfileString() reads "Retrieves a string from ... an initialization file". 2A02:8108:50C0:1E18:B9A2:A2FC:B1FE:A0BD (talk) 18:03, 21 June 2020 (UTC)[reply]

INI files usually store the 'configuration' of a program from one session to another. When the program starts, it inititializes (sic) its settings with this info. 141.35.9.91 12:40, 8 March 2006 (UTC)[reply]

I think INI files were originally used only for Windows system initialization itself, eg, the position of the program manager window. Originally, applications programs would maintain saved information, such as window position, in ad hoc data files. But eventually they started copying what system applications did, by storing small amounts of application data into the main win.ini file. It was only later that programs started using the 'private' ini files. So it's most likely that "initialization" refers to the initialization of some early version of Windows.

It's interesting to see how Win95 went back to an earlier time by re-centralizing all third-party application configuration into a system file. The real difference going from win.ini to user.dat is better performance, increased difficulty of editing, and a heirarchal format. AaronWL 20:12, 11 May 2007 (UTC)[reply]

Not just Windows

[edit]

.ini files are not just used for windows. I have seen them used for php. If they have historically been used for Windows or Microsoft created it the article should reflect that. Phy1729 16:53, 10 July 2007 (UTC)[reply]

I agree they are used in many places. But the PHP ini format, in the case you mentioned, is a different format. Still, they are used widely, I agree. — Preceding unsigned comment added by 84.229.121.52 (talk) 01:24, 23 June 2011 (UTC)[reply]

Several other programs (on Unix/Linux) use the .ini format for configurations, most notably BOINC, compiz, git, gtk-2.0, mc and Totem. The configuration files don't necessarily have an .ini extension though. — Preceding unsigned comment added by Subogero (talkcontribs) 16:16, 15 October 2011 (UTC)[reply]

Python for example has a ConfigParser module that generates and handles an INI-like file format (usually stored as .conf). Also, freedesktop.org's .desktop files have a similar format. — 80.174.59.222 (talk) 23:13, 10 January 2012 (UTC)[reply]

User:84.229.121.52 claims that "the PHP ini format, in the case you mentioned, is a different format". What, pray tell, is the name of this other format if it's different from the "INI file format" used by most Windows ".ini" files? I see that Christian Vigh ("Extended Ini File: Load and edit configuration INI format files") and two references that I recently added to this "INI file" article seem to be saying that the "the php.ini file" is actually the same format as most Windows ".ini" files. Have I misinterpreted all three of those people? --DavidCary (talk) 05:17, 12 November 2017 (UTC)[reply]

What is the purpose of desktop.ini files?

[edit]

What is the purpose of desktop.ini files? —Preceding unsigned comment added by 71.101.145.61 (talk) 03:44, 25 September 2007 (UTC)[reply]

I think they manage the layout of the icons in Windows Explorer for that folder. —Preceding unsigned comment added by 68.238.201.184 (talk) 06:24, 16 March 2008 (UTC)[reply]

Yes, it monitors any changes to folders (see http://www.ofzenandcomputing.com/zanswers/797 )(98.208.71.226 (talk) 07:29, 25 May 2008 (UTC)LeRoy Pea)[reply]

Why desktop.ini links here? There is nothing about it currently. — Preceding unsigned comment added by 178.140.240.108 (talk) 03:29, 5 November 2011 (UTC)[reply]

I agree that since desktop.ini redirects to this INI file article, this article should say a few words about it -- so I added a sentence about it (with reference). --DavidCary (talk) 15:37, 1 December 2017 (UTC)[reply]

Case sensitivity

[edit]

 Done

The article should mention case sensitivity. The Windows implementation is not case-sensitive, but I don't about other implementations. 63.116.23.136 (talk) 02:35, 18 November 2011 (UTC)[reply]

Done. Mitch Ames (talk) 03:07, 2 June 2012 (UTC)[reply]

Keys or properties

[edit]

If recent edits changing "property" to "key" are correct, we probably should change all of the other uses of the term throughout the article. Mitch Ames (talk) 07:18, 23 November 2012 (UTC)[reply]

Also worth noting..

[edit]

In Windows' standard implementation all values are literal strings. That is:

[fruit]
grapes=2
bananas="3"

Will set grapes to be the string 2, but bananas literally to be the string "3" (including the quotes) and not 3 as you might expect for a program variable.

— For which versions of Windows is the above true? It is not for Windows 10. In fact, the article explicitly states the opposite. 2A02:8108:50C0:1E18:B9A2:A2FC:B1FE:A0BD (talk) 17:59, 21 June 2020 (UTC)[reply]

Unlike registry values, backslashes do NOT need to be doubled. (escaped)

Also, php's handling of ini files differs from Windows, in that for predictable behaviour the value names MUST be quoted strings, not plain strings. Otherwise parse_ini_file() replaces any same-named program variable with this value. This can lead to some very strange results. It is possibly a security issue, since in principle an ini file could, for example, be crafted to null-out a password variable if the variable's name is known.

Versions 5.3 on have the parameter INI_SCANNER_RAW to override this behaviour. --Anteaus (talk) 19:56, 25 July 2013 (UTC)[reply]

Windows NT vs. Windows 2000

[edit]

There's a predecessor/timing conflict in the introduction. Windows 2000 was based on Windows NT. INI files were primarily for 16-bit systems and applications, and can legitimately include Windows ME. Windows 2000 should not be included in the paragraph with Windows ME, as Windows 2000 came after Windows NT and was Registry-based. -- Dave Braunschweig (talk) 19:15, 25 October 2014 (UTC)[reply]

not all ini have the keys = value

[edit]

Not all ini have the key=value instead it have

[section] value1 value2 value3

a predefine number of values. each by a line it self — Preceding unsigned comment added by 87.73.41.242 (talk) 08:29, 20 April 2018 (UTC)[reply]

That is certainly not the standard format, where do you claim to have seen that?
Also beware that some Microsoft tools will incorrectly not display line breaks in UNIX-format text files, so a unix/linux ini file using LF line breaks may display in Microsoft tools as one very long line. Jbohmdk (talk) 21:09, 4 September 2023 (UTC)[reply]

Disabled entries recognition

[edit]

There is a column 'Disabled entries recognition' in the comparison table, but it is not explained what it is or what an example of that is in and .ini file. — Preceding unsigned comment added by 2003:C4:9F1E:2D01:D875:1C1B:99CC:56E5 (talk) 04:22, 4 September 2019 (UTC)[reply]

Are sections optional?

[edit]

The article states "Keys [need not] be grouped into ... sections". As far as I can tell, this is not true for the Windows implementation. While no error is produced when reading a file without any section headings, say

a=1
b=2
c=3

I can find no way to access any of its values using GetPrivateProfileString().

At least ConfigParser seems to have the same limitation, judging from this stackoverflow question where answers appear to boil down to tricking the parser into seeing a dummy section header at the beginning of input.

2A02:8108:50C0:1E18:B9A2:A2FC:B1FE:A0BD (talk) 18:22, 21 June 2020 (UTC)[reply]

Sections are optional in libconfini:

Keys appearing before any section path belong to a virtual root node

— [1]
--109.113.8.149 (talk) 00:47, 15 August 2020 (UTC)[reply]

Comparison of parsers

[edit]

User:WhoAteMyButter deleted the table of INI parsers on 29 JAN 2022, with the summary "All of this is subject to advertising, and does not conform with MOS:TABLE, this list will grow infinitely and has no criteria (anyone can write a key=value parser). Better to just include the native way of doing it.)". I reverted per WP:BRD. I'm not adamant that the table stay unchanged, but am concerned this may be overkill. Would cleanup or selective pruning be a better strategy? To address particular points:

  1. It's not advertising in the usual sense; these are almost all Free/Open projects. I recognize that someone can still push a Free project for non-monetary reasons, but is there any evidence that's happening here?
  2. I'm not seeing how this does not conform to MOS:TABLE. It's tabular information; it uses wiki markup; it uses standard table templates. What's the issue?
  3. While it's true that any component programmer can write a parser, and potentially the list could grow huge, I think we should act on that when it actually becomes a problem. If needed, we can split it out to a separate page (cf., Comparison of wiki software).
  4. There is no "native way" on many platforms. Linux, MacOS, Java, Android, etc., all have a multitude of options. If we mean "Windows only", then sure, but I don't see why we should limit the article to Windows.

Please add your thoughts. —DragonHawk (talk|hist) 04:41, 30 January 2022 (UTC)[reply]

I was concerned about the fact that there already exists a way to access and modify INI from Microsoft's own API. Why include a table of all the parsers in various languages? We aren't a product catalogue. For example, both JSON and TOML do not have such parser comparisons, but they do have format comparisons. A comparison of parsers isn't really helping the reader; they don't tell us anything more about the format, or what it is. We're not a usage guide, either. Almost none of the listed software have reliable sources indicating their encyclopedic value or importance. Sure, they exist. But that doesn't mean we should include them. If a table is to be included, I think a majority of the entries should be removed. Mainly, the ones redlinked. Furthermore, I think that only parsers widely in use would & should be included (Java's own, MS' C API, not a package that a few people used).
-
As for the `Comparison of INI parsers` article idea, I disagree that such an article can exist regardless. According to WP:LSC, Criteria for inclusion should factor in encyclopedic and topical relevance, not just verifiable existence. None of these parsers have any notability, importance, or value aside from existing and working with a different language. Not only that, but the end of LSC says to avoid redlinking entries which are unlikely to get an article soon or ever. WhoAteMyButter (📨talk📝contribs) 05:37, 30 January 2022 (UTC)[reply]
I also find the § Comparison of INI parsers useful. As there is no formal INI standard, the only standards come from parsers. Many who need to access INI files do not do that under Windows, and even under Windows the INI dialect supported by the Windows API might be considered obsolete today (several INI libraries support more advanced features). --RedPint (talk) 17:01, 23 February 2022 (UTC)[reply]

PHP parse_ini_string / parse_ini_file

[edit]

Is this a place to add PHP's library function parse_ini_file and parse_ini_file? Theking2 (talk) 14:53, 20 June 2022 (UTC)[reply]

Relationship with .reg and .inf files

[edit]

Windows has two INI-like file formats that are handled by other parsers but can be considered as INI files from a design and editing perspective:

  • .reg files are textual representations of a subset of the registry or changes thereto, they begin with a magic string for the format version and support a syntax variant for deleting entire (INI)keys and (INI)sections. Character set for some versions is UTF-16LE, others use the locale charset. The parser/generator of this file format is logically in the REGEDIT.EXE system program and/or the newer REG.EXE program.
  • .inf files are textual descriptions of system components in NT 5.x and older, and are also used to provide device driver installation. The parser of this format is in the "Setup API" used by both driver installation and NT 3.x to 5.x system installation. Note that some other software uses the .inf extension for other INI-like files.

Finding details and sources is left as an exercise for other editors

Jbohmdk (talk) 21:23, 4 September 2023 (UTC)[reply]

Spaces around the equals are important in Windows

[edit]

The examples in the article show spaces around the equals sign between key and value:

[section]
key1 = a
key2 = b

A .NET INI-reading/writing library I was using would read and write files as shown above (with the spaces), but it had serious bugs and I had to abandon it. I replaced it with calls to WinSDK APIs like GetPrivateProfileString().

In (Windows 10) testing, I discovered that the new code couldn't read INI files created by the old library. At first I thought it had to do with BOM or UNICODE vs ANSI. Instead, it turned out that the WinSDK APIs didn't like the spaces around the equal signs between key and value. It has to be formatted without the spaces, e.g.:

[section]
key1=a
key2=b

You can confirm this in Windows by doing a Find in Files for ␠=␠ in C:\Windows\*.ini - I got zero hits out of 800+ .ini files searched.

ProfSchmitty (talk) 21:23, 1 January 2024 (UTC)[reply]

Citation for the claim that .desktop is a .ini format does not directly appear to support the claim.

[edit]

Paraphrased, as this StackExchange comment explains:

The "INI page" Wikipedia page claims [that .desktop files can be considered to be .ini files], [but] it doesn’t confirm it; the source for the claim doesn’t compare the .desktop format to a .ini format.

Does a better citation exist, or might the assessment be incorrect? Tag me if you are responding to my content or wish to notify me, because I may not be subscribed. (talk) 15:13, 28 May 2024 (UTC)[reply]