From: dahe@cre.canon.co.uk (David Elworthy)
Subject: GDBM
28 Nov 1997 16:25:12 -0800
Message-ID: <347EE49E.D3608BCF.cygnus.gnu-win32@cre.canon.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: gnu-win32@cygnus.com

A little while ago there was a discussion on getting gdbm to work with
gnuwin32. If you do it blindly, you get fatal read errors, and the
proposed cure was to mount the filesystem with the gdbm database file on
it as binary using mount -b.

A simpler solution is this: edit gdbmopen.c, and in every open call, add
"|O_BINARY" to the second parameter, so you get things like
dbf->desc = open(dbf->name, O_RDONLY|O_BINARY, 0);
There's about 4 places you need to make the change. After doing this, it
should work no matter how the file system was mounted. I've only tried
this on a couple of small examples, but it seemed to work OK.

-- David Elworthy

_______________________________________________________________________
David Elworthy <dahe@cre.canon.co.uk>
Canon Research Centre Europe Ltd., Guildford, Surrey, UK
URL: http://www.cre.canon.co.uk/
Phone: +44 1483 448844; Fax: +44 1483 448845
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
