Writing large INI files

Writing large INI files

INI files, once the most used way for storing program configurations, are still popular due to their simplicity. Delphi offers two ways for accessing them ...
http://blog.dummzeuch.de/2016/10/23/writing-large-ini-files/

Comments

  1. Thomas Mueller I don't think so. A simple SQLite db will serve as param storage way better than ini. And plus, its platform agnostic

    ReplyDelete
  2. INI is platform agnostic too. As for sqlite: Can you view and edit it with a text editor? No.

    ReplyDelete
  3. I can confirm that the 64k limit has been dropped since Windows 2000. Not sure about Windows NT 4 and below, but it was definitely valid until Windows 95/98/ME.

    ReplyDelete
  4. Thomas Mueller ini could be implemented on various systems. But there is not a library, so, different implementations will have different performances, different restrictions and even different problems. You don't get that with SQLite which is 'one library to rule them all'. The only bottleneck is file I/O, because sqlite leverages that to the underlying os

    Also there is no (practical) data size limit, perf wont drop even with lots of data, blob support, a type system (yes, its weak and dynamic, but its something), ACID safety, and the list goes on

    You can't view it with a text viewer. True, but I could say the same, you can't view a ini file w/o text viewer. Of course, nowadays every os will have a text viewer. But hey, nowadays almost every os ships with the sqlite library. Also even some come with a simple and minimalistic sqlite db viewer. How many countless sqlite viewer are out there? pick the one which suits your needs better

    ReplyDelete
  5. We use the INI format to store various per-user settings in the database, as long varchars. Very convenient indeed.

    ReplyDelete
  6. Agustin Ortu​​ INI is a (very simple) file format, you don't need an API for that. In the case of Delphi it comes with a native implementation of an access object. I'm not saying it is the solution for everything, but it certainly has its place.

    ReplyDelete
  7. I found a class called TBigINI years back and I use it periodically for small simple DB needs. Nothing to configure, very easy to use. I added ctors to let you pick which canonical folder to use for the data. It makes the use of INI files far easier for a lot of common needs.

    ReplyDelete
  8. How about multiple repeated keys in a section like PHP.ini e.g. extension=...? Is it possible to handle them without rewriting a single key instead of creating multiple repeated keys? like arrays maybe?

    ReplyDelete
  9. Thomas Mueller JSON or XML is very easy and simple editable too, but it is flexible and don't have any INI weakness

    ReplyDelete
  10. Victor Alberto Gil No, not possible. Or, actually it is possible, it just does not conform to the INI file specification.

    ReplyDelete
  11. Jacek Laskowski C++, Python, Perl are very easy and simple to compile too, but they are cross platform and don't have the convoluted Pascal syntax of Delphi.
    Notice something?
    I am not saying that INI files are the best option for all purposes. They are one option of many. They might be the best or the most convenient option for some purposes. They are definitely not the best in general.

    ReplyDelete
  12. Agustin Ortu: "True, but I could say the same, you can't view a ini file w/o text viewer."

    C:\mydir> type myinifile.ini

    ReplyDelete

Post a Comment