Syntactic Confectionery Delight | |
PerlMonks |
Re: Best practices for modifying a file in place: q's about opening files, file locking, and using the rename functionby fmerges (Chaplain) |
on Nov 03, 2006 at 01:14 UTC ( [id://581986]=note: print w/replies, xml ) | Need Help?? |
Hi, If you write all the programs that write to the files, you can use locks, but take care, file locks is not a real restriction, you can ignore it if you want The temporary file, is the $new one, which after doing the stuff you need to do is renamed to the same name as the old. This is not very clean, I would use some control version system, the well known RCS would be enough, you don't need CVS or SVN for simple stuff. For this kind of problem, take a look at some wiki, for example kwiki, they needed also to solve this issue, mean, more than one client wants to make an update. Here you can read more info about file locking with perl. Regards,
fmerges at irc.freenode.net
In Section
Seekers of Perl Wisdom
|
|