Posted by Toby A Inkster on 03/05/07 09:06
Karl Groves wrote:
> I've got a script which writes my blog's RSS feed (rather than dynamically
> generating it each time it is requested), and I'm not sure whether I should
> lock the file while I'm writing it.
Why would you want to? Assuming this script only runs every hour or two,
it's unlikely that two attempts will be made to write to the file
simultaneously. Of course if someone *reads* the file while it's being
written, they'll get a partial feed, but flock() doesn't change that.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|