RE: [PHP] XML file locking
| From: | bruce | Date: | Mon, 19 May 2008 15:23:40 +0000 |
| Subject: | RE: [PHP] XML file locking | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274520@lists.php.net to get a copy of this message | ||
i seriously 2nd what Ivy has stated...
i recently had a short situation where i was dealing with an nfs shared folder, and had to roll my
own "locking" process...
also, keep in mind that if you have multiple processes accessing the targeted file, then you really
need to test various situations to get a feel for how often you might run into file conflicts...
-----Original Message-----
From: Iv Ray [mailto:pobox@verysmall.org]
Sent: Monday, May 19, 2008 7:45 AM
To: bruce
Cc: 'Kaja'; php-general@lists.php.net
Subject: Re: [PHP] XML file locking
bruce wrote:
> Couldn't you also create a rather simple test to determine if the locking of the file
> takes place?
I personally do not trust file system level locks. Even if a software is
not intended to be portable across operating systems, it is possible to
use different file systems under the same operating system, and the
rules might be different. Using file system level locks would require
all possible file systems to be taken into account. And on top of that,
the file systems are actively developed, so this is one more point to
monitor, while maintaining the software. A less trouble free way is to
create a file with the same name and extension ".locked" or similar,
prior to read/write operations. Of course, this works only if the file
is accessing only by one program, or if all programs accessing the file
follow the same convention - but you should see that many file system
level locks are advisory, as well.
See this -
http://en.wikipedia.org/wiki/File_locking
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php