can work it up easily with a binary file by write and replace up to a relatively large number of entries if you know what you are doing.
I am kinda playing devil's advocate because he basically provided no spec (what is "consistent enough"?)
Don’t reinvent the wheel. A SQL database is nothing more than a file either, just with a bunch of useful features and ACID transtions. You can even use SQLite if you really want just 1 file. If you later decide to check for IDs in the set - you can easily create an index for the SQL table. With a file you’ll have to reinvent a database, don’t do that, unless what you want is to learn how databases function.
Обсуждают сегодня