Hi all,

Here's my two cents worth (or less):

Teijo Aulin> I got the following error message: "flock() unimplemented on this
platform...
Teijo Aulin> I see that flock() is not implemented under win 98, so how can I
fix this?


Matt Sergeant> It can't ever be locked under Win9x because it doesn't support
the notion of file locking.

Hmm, that can't be altogether true. Haven't we all seen messages from WinDOS
about "cannot access... resource in use"? Although I'd bet that one would have
to use something from the Windoz API to get this functionality. I don't know of
how to do it myself, but maybe something from Dave Roth (www.roth.net).

Matt Sergeant> The only thing you can hope to do is implement some sort of flock
based on writing a temporary file or something.

That's what I'd do. If you were so inclined, you go crazy and write a common
file that kept interesting locking information. Then have your flock() check
that file. The file could even include fancy (unnecessary) stuff like what
process had the resource locked, the lock time, etc. You could go even more nuts
and implement something that watched for shutdown failures to intelligently
removing the locking data file after reboots.

----
Rodney Broom


Reply via email to