PDA

View Full Version : flock() stopped in the middle


john85
01-21-2003, 02:31 AM
When an online perl application is running, if a user presses "stop" on their browser in the middle of the script execution, does it end the execution exactly where it is?

For example:

If I call flock(DATA,2) at the beginning of a script and someone presses "stop" in the middle of its execution (before flock(DATA,8) is called), does that file remain locked from then on?

This works with a database as well. If a program is writing lots of data to a large database and "stop" is pressed, will unappended data be lost forever? Please help. Thanks.

Calilo
01-21-2003, 03:32 AM
Well, i believe that the execution of the script is done really really quickly, sicne it is executed on the server, so once all the information is received it is executed in .3 seconds,if the user stops it from the browser the info will not be receives so the scirpt will no be executed at all, you might want a second opinion here i dont use flock a lot, not even its brother function on mysql.

Calilo