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

file_put_contents, file lock AND append?

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
0
0
US
I am using the file_put_contents with the append option.

Code:
file_put_contents("filename", "text to write", FILE_APPEND);

Problem is that I want to lock the file as well as append.

Php documentation says to use the "LOCK_EX" flag, however, it does not have examples. How do I pass BOTH the FILE_APPEND and LOCK_EX flags?

Like this?
file_put_contents("filename", "text to write", FILE_APPEND, LOCK_EX);

I dont think the above will work because there is a fourth parameter that can be passed to this function.

Thoughts?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top