in reply to Apache and file generation - flock?
A better idead would be to write to a temporary file, and then, once the write is finished, rename the file to the name that the other processes use.
On most (all?) systems, those processes that have opened the old file will stil get to read the old file until they close it. But the processes that open the file after the rename, will get the new data. Best of all, you will have a guarantee that nobody will be reading a partialy-written file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Apache and file generation - flock?
by Roger (Parson) on Mar 01, 2004 at 12:33 UTC | |
by merlyn (Sage) on Mar 01, 2004 at 14:34 UTC |