![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
|
PHP flock?
Based on another thread I thought I'd ask this in a new one.
Is there any way using flock to 'queue' the file writes in php? All I see is examples how to say "can't get lock" and then die. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
I tried a quick google on it and didn't find anything. I suspect PHP would need to have a "threaded" process, where individual threads had a "wait until ready" state on the file lock, which I don't think PHP has. If it's doable though, I'd definitively like to know.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
|
Bump this thread
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: May 2004
Location: South Florida
Posts: 4,134
|
I dont know but you could try adding a sleep(1) then loop and try again
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
Yeah put the lock in a while loop
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
|
Wicked guys, thanks.
According to this: http://www.hudzilla.org/php/8_11_0.php You don't even need to use a while loop? Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
See. Sometimes this place does teach a person something.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |