>I have a file out on a server that people connected to the network use to add transaction records to. They add the records by USEing the file and appending from their local file. Several employees use this file, the append takes a minute or so...works great.
>
>
>Periodically another user USEis it and reads the accumulated records into his local file for processing. Works great.
>
>The number of users on the system now has greatly increased and every once in awhile two of them try to append to the file and one gets an error. What should be done to lock the file...Do I use the flock() function?
>
>
>TIA
>Chris
APPEND FROM locks the table header. You could use FLOCK() but that would prevent others from editing other records (if that takes place). I would recommend using RLOCK(0) to lock the header. If successful, then do the append and unlock it when done. Otherwise, display a message telling them to try again later.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao