You are here: Re: Two simultaneous write accesses to a text file « PHP Programming Language « IT news, forums, messages
Re: Two simultaneous write accesses to a text file

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
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация