the following code works for new file, but if ReOpen, the data will be accessible.
string storagePath = @"c:\temp\foo"; string storageTreeFile = storagePath + "tree.dat"; string storageBlockFile = storagePath + "block.dat"; hBplusTree storage; if (File.Exists(storagePath + "tree.dat")) storage = hBplusTree.ReOpen(storageTreeFile, storageBlockFile); else storage = hBplusTree.Initialize(storageTreeFile, storageBlockFile, 6); storage = "hello, world"; Console.WriteLine(storage); storage.Shutdown();
Log in to post a comment.
the following code works for new file, but if ReOpen, the data will be accessible.
string storagePath = @"c:\temp\foo";
string storageTreeFile = storagePath + "tree.dat";
string storageBlockFile = storagePath + "block.dat";
hBplusTree storage;
if (File.Exists(storagePath + "tree.dat"))
storage = hBplusTree.ReOpen(storageTreeFile, storageBlockFile);
else
storage = hBplusTree.Initialize(storageTreeFile, storageBlockFile, 6);
storage = "hello, world";
Console.WriteLine(storage);
storage.Shutdown();