[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-WebCGI] How to implement file locking?



Hi

I need to write a forum-script and I thought that in this case file locking
would be a good idea. But how do I do it? flock is not implemented in
MacPERL. I've stumbled across two subs in Mac::Files called FSpSetFLock and
FSpRstFLock. Do they do what I need?

I've tried them and they don't seem to have any effect. My code looks about
as follows:

use Mac::Files;

<...>

open(MKT,"Absolute_File_Path_Here") or die;
FSpSetFLock "Same_Path_As_Above_Here";
@mkt = <MKT>;
FSpRstFLock "Same_Path_As_Above_Here";
close(MKT);

I don't get an error message from MacPerl, but the code doesn't seem to do
anything either. I've written a tiny script that just locks a file that I
then try to access using a different script. I can read and write that file
even though I locked it before!

Does anybody know how to handle those to functions? Is there a different way
of implementing good file locking?

Thx
Thorsten Dittmar

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org