Help: using msvcrt for file locking

Sheila King sheila at spamcop.net
Sun Aug 26 17:19:14 EDT 2001


On Sun, 26 Aug 2001 16:30:20 -0400 (EDT), Ignacio Vazquez-Abrams
<ignacio at openservices.net> wrote in comp.lang.python in article
<mailman.998857940.30409.python-list at python.org>:

:On Sun, 26 Aug 2001, Sheila King wrote:
:
:> Notice that you can append an optional 'l' to the mode, if your
:> installation supports locking.
:>
:> Here is an interactive session:
:>
:> Python 2.1.1 (#6, Aug 16 2001, 17:02:08)
:> [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
:> Type "copyright", "credits" or "license" for more information.
:> >>> import dbhash
:> >>> db = dbhash.open('rec', 'rl')
:> Traceback (most recent call last):
:>   File "<stdin>", line 1, in ?
:>   File "/big/dom/xthinkspot/lib/python2.1/dbhash.py", line 16, in open
:>     return bsddb.hashopen(file, flag, mode)
:> bsddb.error: locking not supported on this platform
:> >>>

:
:Hmmm...
:
:The only thing I can think of is to get a copy of libdb.dll 3.3.1 from
:somewhere 

libdb.dll 3.3.1 for what...SleepyCat? No, I don't want to install
another version on top of the system version. I am going to stick with
the default system install for the bsddb. (I've already had plenty of
fun installing my own version of Python instead of using the system
default of 1.5.2.)

bsddb works fine on this system, if I don't try to do any file locking:

Python 2.1.1 (#6, Aug 16 2001, 17:02:08)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import dbhash
>>> db = dbhash.open('rec', 'r')
>>> for key in db.keys():
...     print key
...
num
name
age
>>> db.close()
>>>

You will notice that SleepyCat has three versions:
http://sleepycat.com/products.html

and I believe our system just has the lowest of these installed.

: (I checked Google and couldn't find it, and I left my copy of
:VC++ 6.0 in my other pants...), 

LOL. Heh, now I'm getting confused. VC++ isn't going to help me with
using bsddb on my webhost. That's a Linux machine.

What I want is to write a script that I can run on my webhost (Linux)
and also on my home machine (Win98) for testing/development.

Anyhow, I think I've got things figured out now.

:put it in your local directory, and try again.
:DLLs, like Python modules, check the current directory before trying the other
:standard directories.

Thanks,

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/




More information about the Python-list mailing list