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

can use flock but not funlock

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
US
i'm trying to lock and unlock a file for editing using the flock and unflock functions. i can use flock fine (ie. flock($fp, 1);) but when i try to use funlock($fp); i get a function undefined. does this have to do with a bad php install on my webhost or am i missing something?
 
If it is 4.01

lock: flock($fp,1); // or 2 for exclusive (writer)
unlock: flock($fp,3);


If post 4.01

lock: flock($fp,LOCK_SH); // or LOCK_EX for exclusive (wirter)
unlock: flock($fp,LOCK_UN);

more on file locking can be found at:


Hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top