How to store dynamic data (unknown number of fields) to a file?

后端 未结 6 1787
野性不改
野性不改 2020-12-29 00:11

I need to store some data in a file. FOR THE MOMENT each record (data set) consists in:

  • a string (variable length),
  • an array of integers (variable len
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 00:42

    I can think of something like one ini- or XML file per "record", with INI files stored in a virtual file system like our SolFS. I don't know, however, what you mean by "easily support 1 mln rows", i.e. what operations must be supported. If you plan mainly random access to some smaller number of records, then it's not a big deal to parse the text files. In other case you might want to look at some binary format, such as binary XML. I can say that TMCDataTree class of our other product, MsgConnect, supports hierarchical ini files saved in binary format.

提交回复
热议问题