RE: [PHP] How to tell if the file is already locked with flock()???
[snip] How do we tell if the file is already locked when someone use a flock() on the file?? [/snip] If your flock attempt returns FALSE then it is likely locked already -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to tell if the file is already locked with flock()???
http://de2.php.net/manual/en/function.is-writeable.php Jay Blanchard wrote: [snip] How do we tell if the file is already locked when someone use a flock() on the file?? [/snip] If your flock attempt returns FALSE then it is likely locked already -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to tell if the file is already locked with flock()???
Um, I think I'll stick to file_exist instead and to unlock, I'll grab the IP address in the text file and match it against the current browser of whoever is using before deleting the file. That way, I'll know who is the guilty party if the person doesn't finish whatever he/she is doing on the browser. Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] How do we tell if the file is already locked when someone use a flock() on the file?? [/snip] If your flock attempt returns FALSE then it is likely locked already -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to tell if the file is already locked with flock()???
Scott Fletcher wrote: Um, I think I'll stick to file_exist instead and to unlock, I'll grab the IP address in the text file and match it against the current browser of whoever is using before deleting the file. That way, I'll know who is the guilty party if the person doesn't finish whatever he/she is doing on the browser. IP address is not reliable identification. And you cannot use flock() either as the lock lasts only while the php script is executed. You should use some uniq string associated with the browser, either cookie or session id. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php