Re: [PHP] about lock some codes.

2012-09-27 Thread Maciek Sokolewicz
On 27-09-2012 11:31, lx wrote: Hello: I have a question now.the code is: $ftemp = fopen($fdoc_tmp/temp_proxy, 'w'); fwrite($ftemp, $content); fclose($ftemp); exec(/usr/local/bin/gdnsproxy -a -f $fdoc_tmp/temp_proxy

Re: [PHP] about lock some codes.

2012-09-27 Thread Jim Giner
On 9/27/2012 7:05 AM, Maciek Sokolewicz wrote: On 27-09-2012 11:31, lx wrote: Hello: I have a question now.the code is: $ftemp = fopen($fdoc_tmp/temp_proxy, 'w'); fwrite($ftemp, $content); fclose($ftemp);

Re: [PHP] about lock some codes.

2012-09-27 Thread Maciek Sokolewicz
On 27-09-2012 15:13, Jim Giner wrote: Even simpler - use the 'tempnam' or 'tmpfile' functions to always have a unique name and avoid having to check for an existing file. Amazing what the php Manual has in it... Good find, I completely forgot about the existence of those functions ;) It's