kaitai-io / kaitai_struct_formats

Kaitai Struct: library of binary file formats (.ksy)
http://formats.kaitai.io
711 stars 204 forks source link

Fix dbf.ksy #621

Closed alexander982 closed 2 years ago

alexander982 commented 2 years ago

More flexible and detailed dbf file parser/analyser. Do not tested on ksc - only in Web IDE

alexander982 commented 2 years ago

Yes. The fact that "type: u1" and "size" do not work together was a surprise for me.

generalmimon commented 2 years ago

@alexander982:

Yes. The fact that "type: u1" and "size" do not work together was a surprise for me.

There is no need for type: u1 here, size alone is enough to create a byte array - see https://doc.kaitai.io/user_guide.html#fixed-size-struct:

With that out of the way, we use a seq element with an array (ordered sequence of elements) in it to describe which attributes this structure consists of. Every attribute includes several keys, namely:

  • id is used to give the attribute a name
  • type designates the attribute type:
    • no type means that we’re dealing with just a raw byte array; size is to be used to designate number of bytes in this array

There is actually a semantic difference between what you get using

alexander982 commented 2 years ago

Thanks. It is more clear for me now