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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file locking in tcl...

Status
Not open for further replies.

huskers

Programmer
Jan 29, 2002
75
US
I have written a package in Tcl to log data to a file. This package creates one file per day and the users can log data to this file. Many users will eventually start using the pacakage and might write to the file at the same time. Is there a way in Tcl to do file locking so that only one particular user can write to the file at a time.
 
I hope I'm wrong, but I don't think you can.

Bob Rashkin
rrashkin@csc.com
 
Yeah. You can.
Even something as simple as the writingt client creating a lockfile and all other processes honoring the convention will work.

 
I've seen this but haven't actually used it ...

Within the package TclX (Extended Tcl), there's a flock cmd which can apply a lock on an open file.

Question: what OS platform are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top