Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending multiple files 1

Status
Not open for further replies.

stormbind

Technical User
Mar 6, 2003
1,165
GB
Hi all,

If site visitors cause files to be appended, how do you stack the tasks so as to complete one set of changes before starting on the next?

Hope that makes sense ;)

----------
I'm willing to trade custom scripts for... [see profile]
 
You will probably need to fork off processes to do the changes. Then implement a lock file schema. If the lock file is present, wait, and then poll for it again.
Code:
while( 1 ){ 
    unless( -e file_lock ) {
       system("touch file_lock");
       open(FILE, "file_to_append");
       ....
       close FILE;
       system("rm file_lock");
       last;
     }
     sleep 2;
}

If there's a module...I'd also like to know. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top