Help: using msvcrt for file locking

Ignacio Vazquez-Abrams ignacio at
Sun Aug 26 20:52:25 CEST 2001

On Sun, 26 Aug 2001, Sheila King wrote:

> On Sun, 26 Aug 2001 12:59:09 -0400 (EDT), Ignacio Vazquez-Abrams
> <ignacio at> wrote in comp.lang.python in article
> <mailman.998845240.31171.python-list at>:
> :On Sun, 26 Aug 2001, Sheila King wrote:
> :
> :> I am intending to use this for programs that will access databases.
> :> Specifically, CGI scripts using the Berkeley data base hash. The
> :> Berkeley Sleepy Cat that I have access to doesn't support concurrent
> :> write access. I have to handle the file locking myself.
> :
> :I'm just curious as to why you're not using a database server for this. Any
> :specific reason?
> Because I don't have access to one. (Not everyone does, you know.)

That's fine; I understand. I was just curious, that's all.

> In my case, I could spend extra $$$ (on the order of $20 extra per month
> over what I'm spending for hosting now) to get a mySQL database, but I
> can't do that right now. (Probably some day, I will.)
> I looked at Gadfly, but it doesn't support concurrent access, and
> requires running a server. I can't have a process running all the time
> in the background (as I mentioned in another post that you may not have
> seen yet), so running it all the time is out. And starting up the server
> every time I want to run a CGI script seems prohibitive (too much time
> and CPU usage).
> Even if I managed to get access to a database server, there'd be someone
> else who wanted to do what I'm doing. It's quite common in CGI scripts.
> I'm guessing, because of the frequent references to the fact that Perl
> only *appears* to provide cross-platform file locking, that many of the
> cgi scripts that are out there don't actually work as the author
> intended.
> --
> Sheila King

I was just poking around in the Sleepycat documentation, and apparently they
have some sort of locking scheme via their C API. Which version on Sleepycat
do you currently have access to, and how are you accessing it? You'll have to
excuse my naïveté when it comes to file-based databases.

Ignacio Vazquez-Abrams  <ignacio at>

More information about the Python-list mailing list