file_put_contents() and locking mechanism
Moderator: General Moderators
file_put_contents() and locking mechanism
Do file_put_contents() and file_get_contents() have locking mechanism built-in?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
According to the documentation (which you have no doubt read thoroughly):
http://www.php.net/manual/en/function.f ... ntents.php
There is a flag named LOCK_EX which appears to do file locking. However that flag was added in 5.1.0 so you would need a current version of PHP5 to use it. Otherwise you would need to do fopen() and then locking.
http://www.php.net/manual/en/function.f ... ntents.php
There is a flag named LOCK_EX which appears to do file locking. However that flag was added in 5.1.0 so you would need a current version of PHP5 to use it. Otherwise you would need to do fopen() and then locking.
(#10850)