Posted by Jerry Stuckle on 03/09/07 03:45
andy.z@blueyonder.com wrote:
> If 2 people try to access the same text file at the same time to write to
> it - what happens in PHP ?
>
> What I mean is - presumably the first will be ok -
> But what will the second person actually see in his browser?
> And what will php do about it if not specifically programmed to deal with
> it
>
> ie whats the default behaviour?
>
> Ta
>
>
>
File corruption. It's only a matter of time before it happens.
And no, the first may NOT be ok.
If you're going to write to files, ensure you flock the file. Or use a
database - which handles concurrency issues for you.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|