使用 C 在 Berkeley DB 中打开数据库时出错
我有一个结构
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);
}
在这个结构中我必须存储值,但现在我在打开数据库本身时遇到错误,提示 access.db: Permission returned。
if ((ret = dbp->open(dbp, NULL, DATABASE, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
dbp->err(dbp, ret, "%s", DATABASE);
}
为什么我们会看到权限被拒绝错误???
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 denied.
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???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论