-----Original Message-----
From: Tom Worster [mailto:f...@thefsb.org] 
Sent: 20 August 2009 01:28 PM
To: Clancy; php-general@lists.php.net
Subject: Re: [PHP] How to make sure that the target file to read is not
under writing by others?

On 8/19/09 9:56 PM, "Clancy" <clanc...@cybec.com.au> wrote:

> I gather from this discussion that PHP allows two users to open a file 
> for R/W? I had assumed it wouldn't.

i think php does allow this. but i'm not sure all file systems do.

--

PHP does allow more than one process to open a file for read-write, as does
every other filesystem I know of (PHP doesn't have a filesystem, it
implements a subset of file commands common to all OS's [some differences
between *nix and Windows] that it uses to communicate with the underlying OS
filesystem). If there's a need to ensure that multiple processes don't step
on each others toes the file can be locked. The two most common file
accesses are read and append, where a lock is mostly not required. It's only
in special cases where you want to write or update something and want to be
sure that another process isn't trying to update the same data or trying to
read data that may no longer be consistent (until you finish your update)
that you'd want to lock it.

Cheers
Arno


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to