From owner-freebsd-current@FreeBSD.ORG Tue Apr 8 15:54:42 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AAF437B404 for ; Tue, 8 Apr 2003 15:54:42 -0700 (PDT) Received: from mail.gmx.net (imap.gmx.net [213.165.65.60]) by mx1.FreeBSD.org (Postfix) with SMTP id 2D2AA43FB1 for ; Tue, 8 Apr 2003 15:54:41 -0700 (PDT) (envelope-from s.moeck@gmx.de) Received: (qmail 22384 invoked by uid 65534); 8 Apr 2003 22:54:39 -0000 Received: from dsl254-062-177.sea1.dsl.speakeasy.net (HELO xpn) (216.254.62.177) by mail.gmx.net (mp007-rz3) with SMTP; 09 Apr 2003 00:54:39 +0200 From: =?iso-8859-1?Q?Stephan_M=F6ck?= To: Date: Tue, 8 Apr 2003 14:54:27 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Subject: DB3 problem with put X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 22:54:42 -0000 I'm using DB3 to store file informationen. The key is the directory name and the value is the inode number. At runtime I recieve the following error message frome the database. Can anybody help me with this problem? key: /test value: 16791 DB->put: DB_KEYEXIST: Key/data pair already exists //should be /test/file DB->put: DB_KEYEXIST: Key/data pair already exists //should be /test/textfile DB->put: DB_KEYEXIST: Key/data pair already exists // ... DB->put: DB_KEYEXIST: Key/data pair already exists DB->put: DB_KEYEXIST: Key/data pair already exists DB->put: DB_KEYEXIST: Key/data pair already exists void add_database(char *sub) { memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = sub; key.size = sizeof(sub); data.data = statbuf.st_ino; //inode number from the stat() call key.size = sizeof(statbuf.st_ino); if ((ret = dbp1->put(dbp1, NULL, &key, &data, DB_NOOVERWRITE)) == 0) { printf("key: %s value: %d\n", (char *)key.data,data.data); } else { dbp1->err(dbp1, ret, "DB->put"); } } The calling function: char *dir; ... add_database(dir); ....