开发者

Error in Opening a database in Berkeley DB using C

开发者 https://www.devze.com 2023-03-29 19:37 出处:网络
I have a structure struct pearson_record{ unsigned char *src; unsigned char *dst; unsigned char type; float rho;

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

精彩评论

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

关注公众号