On Mon, 2 Sep 2002, Ramprasad A Padmanabhan wrote:

> Hi All,
>    I am writing an web application where multiple users may write into 
> the same file concurrently. Also there is a probability that there may 
> be an admin who has opened up the file in 'vi' and editing the file.
> 
>    I want to avoid this  concurrent multiple opens.
> I tried a range on perl modules like IO::LockedFile, File::Flock;
> LockFile::Simple etc but all these do not enforce any lock and worst 
> they lock a file even if it is already open in vi

I guess by default these modules perform advisory locking. This kind of 
locking only works when all the processes accessing the file check for the 
existence of the lock. If they don't you have a problem. 

The alternative is to use mandatory locking, but this will require 
changing the options to your filesystem and remounting them. But I don't 
think you need to go this far for this job.

Why don't you use a database for this job? 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to