开发者

Error in Opening a database in Berkeley DB using C

I have a structure

struct pearson_record{
    unsigned char *src;
    unsigned char *dst;
    unsigned char type;
    float rho;
};

DB *dbp;
int ret;
if ((ret = db_create(&dbp, NULL, 0)) != 0) {
    fprintf(stderr, "db_create: %s\n", db_strerror(ret));
    exit (1);
}

In this structure I have to store values, but right now i get an error in opening the db itself saying access.db: Permission de开发者_运维问答nied.

if ((ret = dbp->open(dbp, NULL, DATABASE, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
    dbp->err(dbp, ret, "%s", DATABASE);     
}

Why do we see a Permission denied error???

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜