You are here: Re: fwrite for log « PHP Programming Language « IT news, forums, messages
Re: fwrite for log

Posted by Erwin Moller on 01/07/08 09:06

Hanoi wrote:
> Hi,
>
> I would like to have a php file that log informations sent by an image
> request.
>
> For logging, I use fwrite to write on a file.
>
> If more requests are done on the same time, there could be a lost of
> data because the file is open by one process and not available for the
> other processes?
>
> Thanks

Hi,

Yes, you should prepare yourself for that indeed.
Use filelocking:
http://nl2.php.net/manual/en/function.flock.php

Filelocking is reliable, even on Windows.

You'll find a basic (but working) example on that page.

Regards,
Erwin Moller

 

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

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