Hello,
On 07/15/2004 12:28 PM, Scott Fletcher wrote:
Hi! I saw the php function flock(), since I never used it before so I thought I would ask you folks a couple of questions.
1) Is this function good or is there a better function somewhere that I'm not aware of?
It depends on what you want to do. There are also semaphores at least under Unix systems.
2) If the flock() activated the file lock then is it possible that I manually unlock the file? Like chmod or something through the Linux console for example.
Externally? Only when the file is close or the program that opened is ended.
3) good example of script just in case..
You may want to take a look at this arbitrary content caching class. It uses file locks to prevent that multiple scripts attempt to access a cache file when it is being updated.
http://www.phpclasses.org/filecache
--
Regards, Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php