Skip to content

The magic data for TreeDBM differs from description #69

Description

@VanyaBelyaev

I am starting using tkrzw for my project project, and I've observed that for tkrzw 1.03.2 the actual structure of the TreeDBM file differs
form the descrition, in particlular the "magic data" corresponds to those expected for HashDBM

Simple check/reproducer

import tkrzw, io

open_params = {
    "concurrent" : True  ,
    "truncate"   : False ,
}

filename = 'QUQU1'

# Prepares the database.
dbm = tkrzw.DBM()

dbm.Open(filename, True, dbm = 'TreeDBM' , **open_params )

aaa = dbm.Inspect()
print ( 'DBTYPE' , aaa['class'] )
dbm [ "first"  ] = "hop"
dbm.Close()

with io.open ( filename  ,'rb' ) as f : s16 = f.read(16)

print ( 'MAGIC9:' , s16[:9] )

it produces the output L

DBTYPE TreeDBM
MAGIC9: b'TkrzwHDB\n'

However according to https://dbmx.net/tkrzw/#treedbm_format
the first four bytes must be TDB\0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions