使用WB B-tree时找不到blkio.c

时间:2018-03-25 08:02:58

标签: b-tree

我按照官方指南安装了WB B-Tree。这个过程进展顺利,但在我进行测试时,我收到了以下错误:

blkio.c: 190: No such file or directory
unable to open database!
blkio.c: 283: Bad file descriptor
>>>>ERROR<<<<  couldn't read blk 0 (read -1 B)
blkio.c: 218: Bad file descriptor

这是我的代码:

#include <stdio.h>
#include <wb/wbsys.h>


typedef unsigned char uchar;
typedef int bool;
#define true 1
#define false 0


int main(int argc, char *argv[])
{
    init_wb(75, 150, 4096);
    HAND* handle; //B-Tree handle

    //open existing database
    SEGD *db = open_seg("/tmp/btree.db", true);
    if (db == false)
    {
        printf("unable to open database!\n");
        exit(1);
    }
}

为什么会出现这样的错误?

1 个答案:

答案 0 :(得分:1)

好吧,如果我不得不猜测,我说它是因为您尝试打开的文件不存在 - 它在错误消息中就是这样说的: - )< / p>

也许您可能想要使用make_seg而不是open_seg。前者用于创建文件,而不是打开现有文件。

并且,就这样没有混淆(由问题标题表示),它没有试图找到C源文件,几乎可以肯定只是包含该文件的文件和行试图读取文件失败的电话。