Reply to Re: Blocking with fopen when file is already open for writing

Your name:

Reply:


Posted by Gordon Burditt on 03/03/07 18:12

>I created a very simple application that reads and writes to a file, I
>was wondering if fopen when opening a file for write access blocks
>this file, i.e. when another user runs this script the script will
>halt until the first user closes its file handle.

You can pretty much count on PHP *not* automatically doing this for
you. For one thing, there are safe ways of two processes both
having the same file open for write and *not* clobbering each other
(e.g. each writes only to its own pre-existing record) that PHP
shouldn't prohibit it.

>If not how can I change php behavior to block such access?

All users of the file can use flock().

[Back to original 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

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