Re: XML file locking

From: Date: Mon, 19 May 2008 14:45:24 +0000
Subject: Re: XML file locking
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-274517@lists.php.net to get a copy of this message
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 --

« previous php.general (#274517) next »